The ip Command v/s the ifconfig Command

The ip command replaces the ifconfig command. In earlier versions of Linux, the ifconfig command was the default utility for checking and verifying IP configuration. However, the ifconfig command does not support many modern features that were irrelevant earlier.

The ifconfig command is deprecated. Although some Linux distributions still include the ifconfig command for backward compatibility in their current version, they may consider gradually removing it from their upcoming versions. Because of this, even if the ifconfig command is still available on some Linux distributions, you should use the ip command for all IP validation and verification-related tasks. It meets the requirements of modern networks.

The following table lists how to perform some common tasks using both commands.

ifconfig command Task ip command
ifconfig Show ip configuration of all interfaces ip address show
ifconfig [interface] Show ip configuration of the specified interface ip address [interface]
ifconfig [interface] down Bring the specified interface down ip link set [interface] down
ifconfig [interface] up Bring the specified interface up ip link set [interface] up
ifconfig [interface] [ip address]
ifconfig [interface] [subnet mask]
Assign a temporary IP address to the specified interface ip address add [ip address/subnet mask] dev [interface]

The following image shows how to list the IP configuration of all interfaces using both commands.

The ifconfig or ip commands

The following image shows how to change the link state information of an interface using both commands.

The ifconfig v/s ip commands

The following image shows how to assign a temporary IP configuration on an interface using both commands.

Comparing ip and ifconfig commands

Conclusion

The ifconfig command is deprecated. Some Linux distributions have removed it, while others still include it to provide backward compatibility. Regardless of whether the ifconfig command is available, you should always use the ip command.

ComputerNetworkingNotes Linux Tutorials The ip Command v/s the ifconfig Command

We do not accept any kind of Guest Post. Except Guest post submission, for any other query (such as adverting opportunity, product advertisement, feedback, suggestion, error reporting and technical issue) or simply just say to hello mail us ComputerNetworkingNotes@gmail.com