Header Shadow Image


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,
 

Leave a Reply

You must be logged in to post a comment.


     
  Copyright © 2003 - 2013 Tom Kacperski (microdevsys.com). All rights reserved.

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License