Loopback address and network interface handling, general commands
U
SER
G
UIDE
156
resets the ARP table associated with the eth0 interface.
The command
ip neigh flush all
resets the ARP table on all network interfaces
ip neigh del IPADDR lladdr xx:xx:xx:xx:xx:xx dev <ifname>
delete the entry relative to the specified IP address in the ARP table
ip neigh del 10.10.254.252 lladdr 00:0D:5A:00:00:01 dev eth0
You can add a static entry using:
ip neigh add IPADDR lladdr xx:xx:xx:xx:xx:xx dev <ifname>
For example, the command
ip neigh add 1.1.1.1 lladdr 00:00:00:00:00:01 dev eth0
associates permanently the MAC number 00:00:00:00:00:01 to the address 1.1.1.1.
The command
ip neigh
add could fail if the specified address is already associated with another
MAC address
,
in that case you can replace it with
ip neigh replace IPADDR lladdr xx:xx:xx:xx:xx:xx dev <ifname>
the above command adds the static entry if it doesn‟t exists or it just modify it if it is already there.
Disabling a network interface through IP command
In order to close a network interface, the
ip
command syntax is:
ip link set <ifname> down
In order to enable it again, the command is:
ip link set <ifname> up
Adding a network address through IP command
In order to add an address to a network interface, the
ip
command syntax is:
ip addr add <ip-address>/N dev <ifname>
In order to eliminate it, the command is:
ip addr del <ip-address>/N dev <ifname>
For example:
ip addr add 172.20.1.1/24 dev eth1
D
ISPLAY AND MANAGEMENT COMMANDS
There are various commands that consent to display the status of the router.
To display ARP table:
root@IMOLA>
show arp