Networking Forums

Networking Forums > Computer Networking > Linux Networking > DCHP overrides default gateway and nameserver on double-nic server.

Reply
Thread Tools Display Modes

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

 
 
Morten ab Lange
Guest
Posts: n/a

 
      10-16-2003, 02:25 AM
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
 
Reply With Quote
 
 
 
 
Neil Horman
Guest
Posts: n/a

 
      10-16-2003, 11:38 AM

Morten ab Lange wrote:
> 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


Depending on what dhcp client you use, there may or may not be different
ways to configure what you want. For instance, with dhcpcd, there was a
command line switch you could add to its arguments which avoided
overwriting your /etc/resolv.conf file. If you use dhclient, there is
a script file that will run to generate your dhcp requests and parse
your responses. In that script (/sbin/dhclient-script in Red Hat 9) are
directvies which re-write /etc/resolv.conf. Simply comment them out.

HTH
Neil

--
/************************************************** *
*Neil Horman
*Software Engineer
*Red Hat, Inc., www.redhat.com
*gpg keyid: 1024D / 0x92A74FA1
*http://www.keyserver.net
************************************************** */

 
Reply With Quote
 
Morten ab Lange
Guest
Posts: n/a

 
      10-16-2003, 06:12 PM
Neil Horman <(E-Mail Removed)> wrote in message news:<bmm0rl$r54$(E-Mail Removed)>...
> Morten ab Lange wrote:
> > 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 ...
> >

(...)
>
> Depending on what dhcp client you use, there may or may not be different
> ways to configure what you want. For instance, with dhcpcd, there was a
> command line switch you could add to its arguments which avoided
> overwriting your /etc/resolv.conf file. If you use dhclient, there is
> a script file that will run to generate your dhcp requests and parse
> your responses. In that script (/sbin/dhclient-script in Red Hat 9) are
> directvies which re-write /etc/resolv.conf. Simply comment them out.
>
> HTH
> Neil


Thanks for your reply.
The
PEERDNS=no
line in ifcg-eth1 is supposed to invoke the -R switch to dhcpcd (
ignoring updates to nameserver pointers), but it doesn't seem to work.
REgarding dhclient , it seems to be unavailable through up2date for RH
Enterprise Linux 2.1. I might consider installing it as a source rpm
etc but that would break part of the philosophy behind RH Linux
Enterprise Server.

Best Regards,
Morten
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Win 2k3 Server loosing default Gateway Scott Elgram Windows Networking 0 04-02-2007 05:15 PM
default gateway ip disappears on a w2k3 server mikee Windows Networking 1 11-11-2006 09:38 PM
DHCP Server Losing default gateway after reboot Nick Windows Networking 0 11-09-2006 10:50 PM
Windows 2003 server loses 'default gateway' Blake Windows Networking 20 06-05-2005 11:36 PM
Default Gateway changing on Server 2k3 JamesSF Windows Networking 4 03-01-2005 10:54 PM



1 2 3 4 5 6 7 8 9 10 11