DCHP overrides default gateway and nameserver on double-nic server.

From: Morten ab Lange (morten_nospam_at_yahoo.com)
Date: 10/16/03


Date: 15 Oct 2003 19:25:28 -0700

Hello,

I am setting up several Linux boxes ( RedHat Enterprise Linux 2.1,
kernel 2.4.9-e.27) that use two different ethernet interfaces.

eth0 is used for setup and administration purposes and the adress is
obtained by DHCP from a windows 2003 server ( HP/Compaq blade
infrastructrure more or less dictates this ). This all works well,
except for the fact that I also
get a default gateway from the DHCP-server. ( In spite of a config in
the Windows DHCP that seems to say no info on gateway nor nameserver
should be supplied to clients )
This default gatway is for the net that eth0 is on (the "DHCP-net")
but I need to use a gateway on the net where eth1 is as my default gw.

1. Are there any undocumented switches to stop dhcpcd from acting on
info it receives about default gateways ? the PEERDNS=no is supposed
to prevent the same for nameserver info but my /et/resolv.conf is
overwritten all the same.

2. Any workarounds at all ? ( My colleague on the windows side is
working on "tuning" the DHCP server .. ) The only obviuous that I see
(reluctantly) one is to quit using DHCP ...

I guess it is not very commmon to use DHCP on multiple interface
_servers_, so not many "eyeballs" have witnessefd this behaviour yet.
I suspect the problems might be due bugs/deficiencies both in Linux
and Windows (?)

Best Regards ,
Morten

The fragments below should shed some light on the problem :

[root]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
ONBOOT="yes"
DEVICE="eth0"
BOOTPROTO="dhcp"
PEERDNS=no # This does not work as advertised

[root]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
PEERDNS=no
TYPE=Ethernet
IPADDR=172.16.3.136
NETMASK=255.255.255.0
NETWORK=172.16.3.0
BROADCAST=172.16.3.255
# GATEWAY=172.16.3.1 # This has no effect..

[root]# cat /etc/sysconfig/network
NETWORKING="yes"
HOSTNAME="orappt"
GATEWAY=172.16.3.1 # This has no effect
GATEWAYDEV=eth1 # This has no effect

## Correct routing table and /etc/resolv.conf:
Destination Gateway Genmask Flags MSS Window
irtt Iface
172.16.3.0 0.0.0.0 255.255.255.0 U 40 0
0 eth1
172.16.65.0 0.0.0.0 255.255.255.0 U 40 0
0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 40 0
0 lo
0.0.0.0 172.16.3.1 0.0.0.0 UG 40 0
0 eth1
nameserver 172.16.3.90
nameserver 172.16.3.19
domain example.com

## Incorrect routing table and /etc/resolv.conf:
Destination Gateway Genmask Flags MSS Window
irtt Iface
172.16.3.0 0.0.0.0 255.255.255.0 U 40 0
0 eth1
172.16.65.0 0.0.0.0 255.255.255.0 U 40 0
0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 40 0
0 lo
0.0.0.0 172.16.65.240 0.0.0.0 UG 40 0
0 eth0
nameserver 172.16.65.240
domain
search



Relevant Pages

  • Re: DCHP overrides default gateway and nameserver on double-nic server.
    ... > kernel 2.4.9-e.27) that use two different ethernet interfaces. ... > get a default gateway from the DHCP-server. ... > the Windows DHCP that seems to say no info on gateway nor nameserver ...
    (comp.os.linux.networking)
  • Re: Help Pls Routing Dhcp & Static
    ... > I am attempting to configure a linux box to act as a router in a network ... > comprising a Win2000 network utilising Dhcp and a Linux network using ... > a seperate linux internet gateway. ...
    (comp.os.linux.networking)
  • Re: Problems with DHCP Setup
    ... > DHCP is not getting set-up correctly on the Linux side. ... gateway address then it should normally become the default gateway. ... I think these special routes are not needed under Linux because its ...
    (Debian-User)
  • Re: [SLE] Network problems Help!!!!
    ... You would also need to set up the gateway machine to forward packets, ... nameserver 192.168.1.2 (or other address if you know of an external ... can you ping the NT box from the Linux box. ... > NIC and switch are working. ...
    (SuSE)
  • Re: Vonage and home LAN, anyone get them to work together?
    ... VoIP worked just fine sat behind my Linux box that provided DHCP and NAT ... What network traffic do you see on your home Linux gateway when you ... become clear if you watch what's happening. ...
    (comp.os.linux.networking)