Linux 101 : Most used "ip ..." commands for networking
To display the network interfaces we have on a machine, we could use the below command:
To add an IP address and a netmask to our interface, we use the below command:
The first line shows us a route to the "10.15.4.0/24" network.
The second line describes the default route to other networks if none is exits.
To add a static route to a network, we use:
It tells the machine to send traffic for the network "10.30.10.0/24" through the IP address "10.122.2.4" and the interface "eno1".
To delete the above route, we use the below command:
To get the Mac table "ARP cache", we use the below command:
To add an entry - IP address, MAC address, interface - to the "ARP table", we use the below command: