f you’ve been around Linux long enough, you know tools come and go. This was assumed to be the case back around 2009 when the debian-devel mailing list announced plans on deprecating the net-tools package due to lack of maintenance. It is now 2015 and net-tools is still around. In fact, as of Ubuntu 14.10, you can still issue the ifconfig command to manage your network configuration.
However, in some instances (e.g., Ubuntu Docker container), the net-tools suite isn’t installed by default. This means the ifconfig command isn’t available. Although you can install net-tools with the command
sudo apt-get install net-tools
it is most often recommended to move forward with the command that has replaced ifconfig. That command is ip, and it does a great job of stepping in for the out-of-date ifconfig.
Thing is, ip is not a drop-in replacement for ifconfig. There are differences in the structure of the commands. Even with these differences, both commands are used for similar purposes. In fact, ip can do the following:
-
Discover which interfaces are configured on a system
-
Query the status of a network interface
-
Configure the network interfaces (including local loop-back, and Ethernet)
-
Bring an interface up or down
-
Manage both default and static routing
-
Configure tunnel over IP
-
Configure ARP or NDISC cache entry
With all of that said, let’s embark on replacing ifconfig with ip. I’ll offer a few examples of how the replacement command is used. Understand that this command does require admin privileges (so you’ll either have to su to root or make use of sudo — depending upon your distribution). Because these commands can make changes to your machine’s networking information, use them with caution.
NOTE: All addresses used in this how-to are examples. The addresses you will use will be dictated by your network and your hardware.
Now, on with the how-to.
Discover which interfaces are configured on a system
Query the status of a network interface
Configure the network interfaces (including local loop-back, and Ethernet)
Bring an interface up or down
Manage both default and static routing
Configure tunnel over IP
Configure ARP or NDISC cache entry
No comments:
Post a Comment