lanix@lanix ~ $ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.0.0.138 0.0.0.0 UG 0 0 0 wlan0
10.0.0.0 0.0.0.0 255.255.255.0 U 9 0 0 wlan0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
I am having some difficulty in understanding the 0.0.0.0 entries in the Gateway and Genmask columns.
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.0.0.138 0.0.0.0 UG 0 0 0 wlan
I understand that the destination (0.0.0.0) is the least specific match meaning packets which do not match the other routes will use this route. However I do not understand the corresponding Genmask entry (0.0.0.0).. Packets which do not match the other routes will be sent to the gateway 10.0.0.138 but what is the subnet mask? 0? 10.0.0.138/0 looks a bit odd. Shouldn't it be something like /32? As in the gateway is a single address..
Thanks.
0.0.0.0
means that the subnet is link-local i.e. there is no gateway involved, the packets are delivered directly to the target. – Hauke Laging Feb 08 '15 at 22:12