Bug 126393 - dhclient was not properly setting the default gateway ip
dhclient was not properly setting the default gateway ip
Product: Fedora
Classification: Fedora
Component: dhcp (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Jason Vas Dias
Depends On:
  Show dependency treegraph
Reported: 2004-06-21 01:59 EDT by Reginald Melchisedek Poyau
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version: dhcp-3.0.1-6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-04-10 12:57:45 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Reginald Melchisedek Poyau 2004-06-21 01:59:03 EDT
Description of problem:
/sbin/dhclient-script was imporperly setting the default gateway ip

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

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
from /sbin/dhclient-script resolved this issue
Comment 1 Reginald Melchisedek Poyau 2004-06-24 10:31:22 EDT
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 '' - 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 16:33:25 EDT
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 netmask \
                broadcast up
    # Add route to make broadcast work. Do not omit netmask.
    route add default dev $interface netmask

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, they
set the default route to be through the $interface, which at
that time is given address (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-17 23:46:52 EDT
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 12:57:45 EDT
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.