DHCPD and DHCLIENT: Routes and gateway disappear or go missing or get removed
On one of the Linux hosts, the routes were correctly populated:
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.0.0.1 0.0.0.0 UG 0 0 0 eth0
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
however, after a few seconds, the routes were removed:
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
This then results in:
Request timed out.
or in:
Network is unreachable
The issue was in the DHClient configuration file used by dhclient:
# cat /etc/dhcp/dhclient.conf
supersede dhcp-lease-time 5;
supersede dhcp-rebinding-time 5;
supersede dhcp-renewal-time 5;
This resulted in routes being added and removed too quickly for the software to keep up. A more appropriate value is below:
# cat /etc/dhcp/dhclient.conf
supersede dhcp-lease-time 86400;
supersede dhcp-rebinding-time 86400;
supersede dhcp-renewal-time 86400;
HTH,