Bug 126393 - dhclient was not properly setting the default gateway ip
Summary: dhclient was not properly setting the default gateway ip
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: dhcp
Version: rawhide
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jason Vas Dias
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-06-21 05:59 UTC by Reginald Melchisedek Poyau
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version: dhcp-3.0.1-6
Clone Of:
Environment:
Last Closed: 2007-04-10 16:57:45 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Reginald Melchisedek Poyau 2004-06-21 05:59:03 UTC
Description of problem:
/sbin/dhclient-script was imporperly setting the default gateway ip
address

Version-Release number of selected component (if applicable):
3.0.1rc13-1

How reproducible:
This was 100% reproducible when the dhcp server was WGT634U (netgear
media router)

Steps to Reproduce:
1. from command line run netconfig as root
2. check "Use dynamic IP configuration (BOOTP/DHCP)" 
** One can also manually edit nic config file
/etc/sysconfig/network-scripts/ifcfg-<interface><n> setting BOOTPROTO=dhcp
3. restart network service /etc/rc.d/init.d/network restart. or do a
ifdown <interface><n>;ifup <interface><n>
4. execute route from command line
  
Actual results:
default gateway ip addr was not correct

Expected results:
default gateway ip addr should have been correct

Additional info:
Commenting line 136: route add default dev $interface netmask 0.0.0.0
from /sbin/dhclient-script resolved this issue

Comment 1 Reginald Melchisedek Poyau 2004-06-24 14:31:22 UTC
Reproducibility:
I was able to reproduce this issue against another dhcp server. 
Additionally, the reason why commenting line 136 works is that at
around line 220 the default gw are set there, but line 136 was
basically setting the default gw to '0.0.0.0' - commenting that out
prevents this.  Of course one cannot set the default gw twice without
first deleting the previous one.

Comment 2 Jason Vas Dias 2004-08-03 20:33:25 UTC
Actually, I think the section of code in question was this:

/sbin/dhclient-script, now lines  130-135: 
  elif [ $relmajor -lt 2 ] || ( [ $relmajor -eq 2 ] && [ $relminor -eq
0 ] )   then
    ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 \
                broadcast 255.255.255.255 up
    # Add route to make broadcast work. Do not omit netmask.
    route add default dev $interface netmask 0.0.0.0
  else

Firstly, why are you running such an ancient kernel ?
Upgrading to a kernel > 2.0 will fix your problem.

These lines do NOT set the default gateway to 0.0.0.0, they
set the default route to be through the $interface, which at
that time is given address 0.0.0.0 (because we don't know 
what other address to give it yet); when it is assigned an
address, the default route will still be through that interface.

Anyway, I agree that 2.0 kernels should be able to obtain a default
route from DHCP. 

This is now fixed in dhcp-3.0.1-6 (requires initscripts-7.60-1).




Comment 3 David Lawrence 2006-07-18 03:46:52 UTC
QA_READY has been deprecated in favor of ON_QA. Please use ON_QA in the future.
Moving to ON_QA.

Comment 4 Matthew Miller 2007-04-10 16:57:45 UTC
There's a version greater than dhcp-3.0.1-6 in FC5. 


Note You need to log in before you can comment on or make changes to this bug.