[Gllug] DHCP and multiple NICs
Iain Conochie
iain at thargoid.co.uk
Thu Feb 28 10:01:34 UTC 2002
On Wed, 27 Feb 2002, Bruce Richardson wrote:
>
> On 2/27/02, 5:20:17 PM, Rodger Etz-Brown <reb at b4mad.net> wrote regarding
> [Gllug] DHCP and multiple NICs:
>
>
> > Howdy,
>
> > am wondering if the following would be possible:
>
> > - One Linux box with one dhcpd started
> > - The machine has got two NICs, eth0 and eth1
> > - According to the NIC where the DHCP request comes from, the server
> > should give out an IP. I.e. request comes via eth0 -> IP will be
> > 192.x.x.x or request comes from eth1 -> IP will be 10.x.x.x
>
> It's a trivial task using the standard ISC dhcp daemon. You just tell it
> which ip ranges to allocate to which subnets. It will listen on all
> interfaces by default and if your networking is configured properly will
> automatically associate the correct nic with the correct subnet.
Not entirely correct - you need to set out different networks in your
dhcpd.conf file ie....
shared-network TESTLAB {
option domain-name "foo.bar.com";
option domain-name-servers dns.foo.bar.com;
subnet 10.44.110.0 netmask 255.255.255.128 {
option routers 10.44.110.102;
range 10.44.110.10 10.44.110.39;
range 10.44.110.60 10.44.110.90;
}
}
shared-network BACKUP {
subnet 192.168.30.0 netmask 255.255.255.0 {
range 192.168.30.10 192.168.30.60;
}
}
This will then ensure that dhcpd will only give out addresses associated
with the card on a particular network. If you have a nic that you do not
want ip addresses given out on then define a network for it but do not
specify a range.
If in any doubt, man dhcpd.conf is a real good man page
Cheers
Iain
--
Gllug mailing list - Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug
More information about the GLLUG
mailing list