Red Hat Bugzilla – Bug 146277
dhclient-script fails add route to gateway before adding the default route
Last modified: 2007-11-30 17:10:59 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5)
Description of problem:
When the host is happen to be on DHCP and the default gateway(router)
IP doesn't belong to the local network (ex: host address is
192.168.4.127 but gateway address is 184.108.40.206) dhclient-script
tries to add default route to gate which fails because the gateway
itself is not reacheable. Only entry in routing table will the for
hosts local network. The dhclient-script ideally add the route to the
gateway first then add the default route if the gateway IP not as the
local network IP.
Note: My machine is on a local lan on DHCP.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1.Get to the DHCP setuation as described
2.run dhclient <interface>
Actual Results: dhclient says Network not reachable and routing table
only contains one entry to local network.
Expected Results: Expected routing table is setup properly with
Created attachment 110259 [details]
Patched dhclient-script: Simple fix adding host route to gw before adding default route
Not sure it is a correct fix or not it works for me.
Your DHCP server is really not meant to be supplying you with a
gateway router that is not on your configured subnet .
This only works in your case because you are evidently on the
same physical LAN as your router and your host sees the router's
ARP entry .
The operator of your DHCP server and router should be configuring
the router with secondary IP addresses for each separate subnet
served by the DHCP server, and giving out those secondary IPs
that are on the lease subnet as the 'router' DHCP option for
each lease .
Also we don't want to add a host route for EVERY gateway, only
for those not on the interface subnet .
A better fix would be as follows:
IF the gateway to be configured is not on interface subnet:
IF an "ARP ping" succeeds for the gateway:
add host route for gateway
emit helpful log message and do not configure interface
configure default gateway
We also need to remember to delete the host route when an interface
is reconfigured .
I'll implement these changes in the next dhcp version for FC3
This is now done in dhcp-3.0.1-31_FC3, which can be downloaded from:
I've tested it with a DHCP server that supplies a router not on the
subnet of the DHCP supplied IP address, and it works fine.
Please test and let me know how it works for you and I'll push it to
I have updated to dhcp-3.0.1-31_FC3 and tested it, it works great thanks.
update package is published