Bug 202425 - ifup drops existing default route in favour of new one received via DHCP
ifup drops existing default route in favour of new one received via DHCP
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: initscripts (Show other bugs)
4.3
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-08-14 08:17 EDT by Mathijs Brands
Modified: 2014-03-16 23:01 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-08-14 10:46:06 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Mathijs Brands 2006-08-14 08:17:58 EDT
Description of problem:

Version-Release number of selected component (if applicable):
  initscripts-7.93.25.EL-1
  dhclient-3.0.1-58.EL4

How reproducible:
  every time

Steps to Reproduce:
1. Configure primary NIC (say eth0) - you can use either DHCP, or do it static
and specify the default gateway in /etc/sysconfig/network
2. Configure the seconday NIC (say eth2) to use DHCP (set ONBOOT=no)
3. Bring up the secondary interface (for instance with 'ifup eth2')
  
Actual results:
  secondary interface is up, previous default gateway has been replaced with the
one received when the secondary interface sent it's DHCP request

Expected results:
  secondary interface is up, gateway has not been changed (see below)

Additional info:
  /etc/sysconfig/network-scripts/ifup states:
   "# remove the default route for the new device (old route wins)"
  As such, I would expect the default route going via eth0 to be kept and the
new route via eth2 to be dropped. However, this is not the behaviour that can be
observed.
Comment 1 Mathijs Brands 2006-08-14 09:06:13 EDT
This is what ifcfg-eth0 looks like:
DEVICE=eth0
BOOTPROTO=static
HWADDR=00:14:4F:40:19:DC
ONBOOT=yes
TYPE=Ethernet
IPADDR=172.27.1.70
NETMASK=255.255.255.0

This is what ifcfg-eth2 looks like:
DEVICE=eth2
BOOTPROTO=dhcp
HWADDR=00:14:4F:40:19:DE
ONBOOT=no
TYPE=Ethernet
PEERDNS=no
Comment 2 Mathijs Brands 2006-08-14 09:47:18 EDT
It seems that dhclient drops the default route - it's not ifup.

I think this bug report can be closed; it will probably boil down to a
configuration issue with dhclient, not a bug in the initscripts. The remark
about duplicate routes does not seem to apply to cases where dhclient is used.
Comment 3 Mathijs Brands 2006-08-14 10:18:56 EDT
Lines 274 and 284 of /sbin/dhclient-script replace the default route. Setting
DHCLIENT_USE_GATEWAY in the ifcfg script (for instance to 'no') circumvents this.
Comment 4 Bill Nottingham 2006-08-14 10:46:06 EDT
Right, this is configurable behavior. Closing as NOTABUG.

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