Loopback address and network interface handling, general commands
U
SER
G
UIDE
155
1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
3: dummy0: <BROADCAST,NOARP,UP> mtu 1500 qdisc noqueue
link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
5: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 100
link/ether 00:0D:5A:04:6F:F6 brd ff:ff:ff:ff:ff:ff
6: eth1: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 100
link/ether 00:0D:5A:84:6F:F6 brd ff:ff:ff:ff:ff:ff
The command
ip address show
displays the interfaces together with the IP address associated:
root@Imola>
ip address show
1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
5: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 100
link/ether 00:0D:5A:04:6F:F6 brd ff:ff:ff:ff:ff:ff
inet 10.10.254.254/16 brd 10.10.255.255 scope global eth0
8: ippp1: <POINTOPOINT,NOARP,UP> mtu 1500 qdisc pfifo_fast qlen 30
link/ppp
inet 11.11.11.11 peer 22.22.22.22/32 scope global ippp1
The command
ip route show
displays the routing tables:
root@Imola>
ip route show
10.8.0.2 dev tun0 proto kernel scope link src 10.8.0.1
85.34.147.96/30 dev atm0 proto kernel scope link src 85.34.147.98
85.34.166.16/29 dev eth1 proto kernel scope link src 85.34.166.18
10.1.10.0/24 via 10.10.254.1 dev eth0
10.10.0.0/16 dev eth0 proto kernel scope link src 10.10.254.254
default dev atm0 scope link
The command
ip neigh show
displays the ARP tables on the router:
root@Imola>
ip neigh show
10.10.4.0 dev eth0 lladdr 00:c0:26:a3:58:52 STALE
10.10.10.10 dev eth0 lladdr 00:40:33:a7:f1:70 STALE
10.10.2.98 dev eth0 lladdr 00:e0:4c:00:00:cd STALE
For each IP address, the corresponding Ethernet Address and the status of the ARP protocol
(
reachable
,
stale
,
delay
,
probe
,
failed
, etc.) is displayed.
Manipulating ARP routing tables through ip neigh command
The
ip neigh
command allows to manipulate the ARP routing table and in particular to delete
certain entries, to add static entries or to replace an existing one.
In order to flush the ARP table, use:
ip neigh flush dev <ifname>
For example, the command:
ip neigh flush dev eth0