0

I'm running isc-dhcp-server on Ubuntu 18.04. Clients without a DHCP reservation are able to get an IP address, subnet mask, default gateway and DNS servers from the pool no problem.

As soon as I define a reservation, the client will correctly get the reserved IP address, subnet mask and DNS servers, however the default gateway will be missing, as shown in this screenshot.

TCP/IP settings pane

Here's my dhcpd.conf file for reference.

ddns-update-style none;
authoritative;                                             
option domain-name "test.lan";                      
option domain-name-servers 10.127.253.236,10.127.253.237;                    
default-lease-time 86400;                                  
max-lease-time 86400;                                      
failover peer "dhcp-failover" {                                 
         primary;                                          
         address 10.127.253.236;                                  
         port 647;
         peer address 10.127.253.237;                             
         peer port 647;
         max-response-delay 60;
         max-unacked-updates 10;
         mclt 3600;
         split 128;
         load balance max seconds 3;
}

subnet 10.127.253.224 netmask 255.255.255.240 {
         pool {
                  failover peer "dhcp-failover";
                  option routers      10.127.253.225;
                  option subnet-mask  255.255.255.240;
                  range 10.127.253.226   10.127.253.238;
         }
         ignore client-updates;
}

##############################
## START OF IP RESERVATIONS ##
##############################

host MacBook-pro {
  hardware ethernet f0:18:98:35:29:6c;
  fixed-address 10.127.253.227;
}
Kitzy
  • 1
  • Did you try adding `option routers 10.127.253.225` to the `host` block? – Piotr P. Karwasz Jan 23 '20 at 21:34
  • I think the fact that the options routers is inside a pool declaration prevents to make it available outside. But I don't know the exact mechanism of the configuration. – A.B Jan 26 '20 at 17:35

1 Answers1

1

To assign a specific address to a host, this address must be in the subnet but not in the range.

A fixed address is not assigned by the pool mechanism and therefore does not benefit from the options of this pool.

And the routers and subnet-mask options are relative to the pool and not to the subnet.

The easiest way here is to assign the address 226 to the host, reduce the pool by making it start at 227 and move the options to the subnet:

subnet 10.127.253.224 netmask 255.255.255.240 {
    option routers      10.127.253.225;
    option subnet-mask  255.255.255.240;
    pool {
        failover peer "dhcp-failover";
        range 10.127.253.227   10.127.253.238;
    }
    ignore client-updates;
}

host MacBook-pro {
    hardware ethernet f0:18:98:35:29:6c;
    fixed-address 10.127.253.226;
}
logypock
  • 11
  • 2