Using the IP command

The ip is a very powerful utility that is used to perform many tasks. Multiple older utilities such as ifconfig and route command were earlier used to perform these functions. The absolute path of the ip command is /sbin/ip.

Following are the examples to illustrate the usage of ip command:

  • The following ip command is used to display the IP address:
$ /sbin/ip addr show
  • The ip command can also be used to display statistics of the network performance (received and transmitted packets, errors, dropped counters, and so on) as shown in command line here:
$ ip -s link show enp0s3
  • The ip command can also be used to display the routing information as shown in command line here:
$ /sbin/ip route show
The /sbin/ip command can also be used to assign multiple IP addresses to a single device using aliases. Binding multiple IP addresses to a single NIC with a different label is useful in many cases (for example, in virtual hosting). Aliases are treated as separate interfaces and are generally configured when NetworkManager is turned off. The command to create an alias is as follows:
$ ip addr add 10.1.1.250/24 dev enp0s8 label enp0s8:0.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.77.4