Bug 202425

Summary: ifup drops existing default route in favour of new one received via DHCP
Product: Red Hat Enterprise Linux 4 Reporter: Mathijs Brands <mathijs>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED NOTABUG QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.3CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-08-14 14:46:06 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:

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.