ISC DHCP – different subnet for specific mac addresses

dhcpisc-dhcp

I'm attempting to create a different subnet for a few specific mac addresses, and have my DHCP config set up as follows:

authoritative;

shared-network local {

 subnet 192.168.2.0 netmask 255.255.255.0 {
  range 192.168.2.1 192.168.2.99;
  option broadcast-address 192.168.2.255;
  option routers 192.168.1.100;
  option domain-name "local-network-spec";
  option domain-name-servers 8.8.8.8, 8.8.4.4;
  deny unknown-clients;
  host mdev {
   hardware ethernet 40:40:40:40:40:40;
  }
 }

 subnet 192.168.1.0 netmask 255.255.255.0 {
  range 192.168.1.1 192.168.1.99;
  option broadcast-address 192.168.1.255;
  option routers 192.168.1.1;
  option domain-name "local-network";
  option domain-name-servers 8.8.8.8, 8.8.4.4;
 }
}

However, I appear to have mis-configured something, because the relevant lease appears as follows:

lease 192.168.1.5 {
  starts 3 2014/04/16 19:10:41;
  ends 4 2014/04/17 07:10:41;
  cltt 3 2014/04/16 19:10:41;
  binding state active;
  next binding state free;
  rewind binding state free;
  hardware ethernet 40:40:40:40:40:40;
  client-hostname "MyMachine";
}

The key here is the routers option is set differently for the different subnet. However, interestingly despite not being an IP address in the desired subnet, the client is provided with the correct gateway – 192.168.1.100 as oppose to 192.168.1.1 – so something is clearly being used from the first subnet declaration.

Any ideas what I'm doing wrong here?

Best Answer

I don't know if this will fix the problem completely, but for starters your router needs to be located on the same subnet. 192.168.1.100 is not within 192.168.2.0/255.255.255.0. If the lease were to be granted as you've configured it, the client would have no path to reach 192.168.1.100 which is on a different subnet.