dhcpd.conf logical hierachy

Narcis Garcia informatica at actiu.net
Sun Oct 15 17:35:15 UTC 2017


Do you mean this setup for example?

authoritative;
use-host-decl-names on;
server-name "director.example.net";
subnet 172.16.0.0 netmask 255.255.0.0 {
        # IP range to be assigned dinamically
        option routers 172.16.20.100;
        option broadcast-address 172.16.255.255;
        option domain-name-servers 172.16.21.61;
        option ntp-servers 172.16.20.100;
        pool {
                range 172.16.20.150 172.16.20.189;
                allow unknown-clients;
        }
}
group MyReservations {
# Without defining subnet/mask ?!
        option routers 172.16.20.100;
        option broadcast-address 172.16.255.255;
        option domain-name-servers 172.16.21.61;
        option ntp-servers 172.16.20.100;
        host printer_1 {
                hardware ethernet **:**:**:**:**:**;
                fixed-address 172.16.20.201;
                option host-name "printer_1";
        }
}




El 14/10/17 a les 18:11, Simon Hobson ha escrit:
> Narcis Garcia <informatica at actiu.net> wrote:
> 
>> In a Debian 9 host, I receive warnings like:
>> Dynamic and static leases present for 172.16.20.201.
>> Remove host declaration printer_1 or remove 172.16.20.201
>> from the dynamic address pool for 172.16.0.0/16
> 
> That was put in a long time ago to deal with a common misconfiguration that keeps popping up and causing problems - especially where people learned on the defective and limited Microsoft server.
> 
>> I'm trying to combine static reservations with dynamic assignment in
>> same subnet:
>>
>> authoritative;
>> use-host-decl-names on;
>> server-name "director.example.net";
>> subnet 172.16.0.0 netmask 255.255.0.0 {
>>        option routers 172.16.20.100;
>>        option broadcast-address 172.16.255.255;
>>        option domain-name-servers 172.16.21.61;
>>        option ntp-servers 172.16.20.100;
>>        pool {
>>                # IP range to be assigned dinamically
>>                range 172.16.20.150 172.16.20.189;
>>                allow unknown-clients;
>>        }
>>        pool {
>>                # IP range to be assigned statically
>>                range 172.16.20.0 172.16.20.149;
>>                range 172.16.20.190 172.16.20.255;
>>                deny unknown-clients;
>> #                deny all clients;
>>                group MyReservations {
>>                        host printer_1 {  # Impressora
>>                                hardware ethernet **:**:**:**:**:**;
>>                                fixed-address 172.16.20.201;
>>                                option host-name "printer_1";
>>                        }
>>                }
>>        }
>> }
>>
>> But I've not clear if "group" and "host" work inside "pool", or what
>> else is the problem.
> 
> You need to do exactly what the message says - remove the address from the pool, or remove it from the host declaration. To do the former you need to split your pool like this :
> 
> pool {
>   range 172.16.20.190 172.16.20.200;
>   range 172.16.20.202 172.16.20.255;
> }
> 
> Also, you should move your host declarations outside of the subnets - they are always global in scope but by putting them inside a subnet you can get some "interesting" inheritance issues that will have you pulling your hair out (think, get address from one subnet, default router from another !)
> 
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users
> 


More information about the dhcp-users mailing list