multiple subnets on the same interface

Glenn Satchell Glenn.Satchell at uniq.com.au
Sat Mar 29 13:27:26 UTC 2008


>To: dhcp-users at isc.org
>Subject: multiple subnets on the same interface
>From: Andi Kleen <andi at firstfloor.org>
>Date: 29 Mar 2008 10:37:44 +0100
>
>For various reasons I'm trying to give one client on a dhcpd
>3.0.5/Linux 2.6.25rc7 served subnet an IP address on a different
>network.  This means there are not multiple interfaces with
>different nets, but a single interface with multiple networks
>configured.
>
>I configured the additional network on the interface and
>everything works great when I configure the client to use a static
>IP address.
>
>But I have a little trouble to get dhcpd to automatically serve
>the different IP.
>
>I tried the two obvious ways
>
>subnet normal subnet  { 
>        range normal subnet;
>
>        host special-client {
>                hardware ethernet mac-address-of-client;
>                fixed-address ip-in-different-subnet;
>                options routers router-in-different-subnet;
>        }
>}
>
>
>and to define two different subnets which would point 
>to the same interface. dhcpd didn't like either. For the first
>option it just ignored the host declaration with the special
>IP address and stubbornly served out an address in the normal
>subnet.  I also cleared out the leases database manually
>from the old address while dhcpd was stopped, but that also didn't
>help.
>
>And for the second option it would complain about
>not being able to find the additional subnet, while it was clearly
>on the interface.
>
>Is there a way to make this work?
>
>Thanks,
>
>-Andi

This is a shared network - two different subnets on the same section of
wire - so you need to define it as such:

shared-network foo {
  subnet 192.168.1.0 netmask 255.255.255.0 {
    range 192.168.1.200 192.168.254;
    option routers 192.168.1.1;
  }
  subnet 10.1.0.0 netmask 255.255.0.0 {
    option routers 10.1.0.1;
  }
}
host special-client {
  hardware ethernet mac-address-of-client;
  fixed-address ip-in-different-subnet;
}

Note that dhcpd "knows" where the request comes from and will only hand
out the fixed address if it will be valid in that subnet. That's why
you must define both subnets as shared in this case.

regards,
-glenn



More information about the dhcp-users mailing list