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
************************************************** */