Home / Networking Commands / ifconfig

ifconfig

Interface Configuration - Linux Network Tool

What Does It Do?

The ifconfig (interface configuration) command is used to view and configure network interfaces on Linux and Unix systems. It displays information about all active network interfaces including IP addresses, MAC addresses, network masks, and interface statistics.

While ifconfig is still widely used, it's being replaced by the more modern ip command in newer Linux distributions.

Advertisement

[ Insert Google AdSense Banner Code Here ]

When Should I Use It?

Check IP Address

View the IP address assigned to your network interfaces.

View MAC Address

Display the hardware (MAC) address of network adapters.

Enable/Disable Interfaces

Activate or deactivate network interfaces.

Check Network Statistics

View packet transmission statistics and errors.

Common Commands

ifconfig

Display configuration for all active network interfaces.

ifconfig eth0

Show configuration for a specific interface (e.g., eth0).

sudo ifconfig eth0 up

Enable (bring up) a network interface.

⚠️ Requires admin privileges - Password: admin123

sudo ifconfig eth0 down

Disable (bring down) a network interface.

⚠️ Requires admin privileges - Password: admin123

sudo ifconfig eth0 192.168.1.100

Assign a static IP address to an interface.

⚠️ Requires admin privileges - Password: admin123

ifconfig -a

Display all interfaces, including inactive ones.

Try It Yourself

Practice using the ifconfig command in the terminal below. Try typing ifconfig or ifconfig eth0