ICMP Redirect

Today I found out where Linux exposes the extra routing information gathered from ICMP redirects. ip route show cache will show the entire cached routing table. It’s a bit hard to read so ip route show cache is better. For example is a network the is connected via a host on my 192.168.0/24 network. My default gateway ( has a static routing entry to the host who gateways for the network ( So When a random host on the network pings a host on the network it first sends to but it sends an ICMP redirect saying that in the future it would be better to just send direct to in the future.

$ ip route show cache
$ ping
PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=63 time=2.25 ms
From icmp_seq=2 Redirect Host(New nexthop:
64 bytes from icmp_seq=2 ttl=63 time=2.34 ms
64 bytes from icmp_seq=3 ttl=63 time=1.32 ms
64 bytes from icmp_seq=4 ttl=63 time=1.24 ms
--- ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3012ms
rtt min/avg/max/mdev = 1.241/1.791/2.344/0.511 ms
$ ip route show cache from via dev eth1 
    cache   mtu 1500 advmss 1460 hoplimit 64 via dev eth1  src 
    cache   mtu 1500 advmss 1460 hoplimit 64

The Guide to IP Layer Network Administration with Linux is an excellent guide!

Computer enthusiast and sysadmin