Bug 202425 - ifup drops existing default route in favour of new one received via DHCP
Summary: ifup drops existing default route in favour of new one received via DHCP
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: initscripts
Version: 4.3
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Bill Nottingham
QA Contact: Brock Organ
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-08-14 12:17 UTC by Mathijs Brands
Modified: 2014-03-17 03:01 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-08-14 14:46:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Mathijs Brands 2006-08-14 12:17:58 UTC
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 13:06:13 UTC
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 13:47:18 UTC
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 14:18:56 UTC
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 14:46:06 UTC
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.