ifconfig
ifconfig
ifconfig
is a command-line utility used to configure network interfaces on Unix-like operating systems, including Linux. It is part of the net-tools package and is used to view and manage network interface configurations.
View All Network Interfaces:
This command displays information about all active network interfaces on the system.
View a Specific Network Interface:
Replace
eth0
with the name of the network interface you want to view. This command displays detailed information about the specified interface.Bring Up a Network Interface:
This command activates the
eth0
network interface.Bring Down a Network Interface:
This command deactivates the
eth0
network interface.Assign an IP Address to a Network Interface:
This command assigns the IP address
192.168.1.10
with a subnet mask of255.255.255.0
to theeth0
interface.Change the MTU of a Network Interface:
This command sets the Maximum Transmission Unit (MTU) of the
eth0
interface to1500
bytes.Assign an IP Address with Broadcast and Netmask:
This command assigns the IP address
192.168.1.10
, subnet mask255.255.255.0
, and broadcast address192.168.1.255
to theeth0
interface.Assign a MAC Address to a Network Interface:
This command assigns the MAC address
00:1A:2B:3C:4D:5E
to theeth0
interface.
Example of ifconfig
Output
ifconfig
OutputWhen you run ifconfig
without any arguments, you might see output similar to this:
Deprecation Notice
While ifconfig
is still widely used, it is considered deprecated in favor of the ip
command from the iproute2
package. The ip
command provides more functionality and better capabilities for modern network configuration.
Basic Usage of ip
Command
ip
CommandView All Network Interfaces:
View a Specific Network Interface:
Bring Up a Network Interface:
Bring Down a Network Interface:
Assign an IP Address to a Network Interface:
Change the MTU of a Network Interface:
Conclusion
ifconfig
is a powerful and widely used tool for network configuration on Unix-like systems. Despite being deprecated in favor of the ip
command, it remains an important utility, especially in legacy systems and for quick network interface management tasks. For modern and more complex networking tasks, transitioning to the ip
command is recommended.
help
breakdown
Last updated