What is ip command in linux
The ip command is a useful tool for assigning an address to a network interface and/or configure network interface parameters on Linux operating systems. It is used to bring interfaces up or down, assign and remove addresses and routes, manage ARP cache, and much more. This command replaces old good and now deprecated ifconfig command on modern Linux distributions. In this article, we will discover the practical use cases of this command Display network interfaces information You can use the following command to display all ip addresses associated on all network interfaces: #ip a Display information about a single interface It is also possible to specify and list particular interface details. #ip addr show dev <interface> Assign IP address to an interface Use the following command to assign an IP address to an interface #ip addr add <ip_address>/<netmask> dev <interface> Add a broadcast address to an interface We have to set the broadcast address manually as the ip command does not set any broadcast address by default. #ip addr add brd <ip_address> dev <interface> Delete an IP address from an interface To delete a previously set ip address, use the following command: #ip a del <ip_address> dev <interface> Display IP routing table You can view the IP routing table by using the following command #ip route list View routing for a distinct network Run this command to view routing for a...
Read More