Bug 146277

Summary: dhclient-script fails add route to gateway before adding the default route
Product: [Fedora] Fedora Reporter: Y Subhash Chandra <yschandra>
Component: dhcpAssignee: Jason Vas Dias <jvdias>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: 3   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: 3.0.1-31 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-08-19 10:11:47 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patched dhclient-script: Simple fix adding host route to gw before adding default route none

Description Y Subhash Chandra 2005-01-26 17:42:06 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5)
Gecko/20050126 Firefox/1.0

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 202.142.94.106) 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):
dhclient-3.0.1-30_FC3

How reproducible:
Always

Steps to Reproduce:
1.Get to the DHCP setuation as described
2.run dhclient <interface>
3.
    

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
default gateway.

Additional info:

Comment 1 Y Subhash Chandra 2005-01-26 17:45:41 UTC
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.

Comment 2 Jason Vas Dias 2005-01-26 19:01:05 UTC
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
     ELSE
         emit helpful log message and do not configure interface
     ENDIF
  ENDIF
  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 
(dhcp-3.0.1-32_FC3).




Comment 3 Jason Vas Dias 2005-01-27 17:59:54 UTC
This is now done in dhcp-3.0.1-31_FC3, which can be downloaded from:
   http://people.redhat.com/~jvdias/DHCP/FC3/3.0.1-31_FC3
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
fc3-updates. Thanks!

Comment 4 Y Subhash Chandra 2005-01-28 15:43:35 UTC
I have updated to dhcp-3.0.1-31_FC3 and tested it, it works great thanks.

Comment 5 Walter Justen 2005-08-19 10:11:47 UTC
update package is published