dhcpd.conf logical hierachy

Bruce Hudson Bruce.Hudson at dal.ca
Wed Oct 18 18:37:23 UTC 2017


On Wed, Oct 18, 2017 at 07:21:15PM +0200, Narcis Garcia wrote:

> Better now?
> 
> shared-network MyMap_interface1 {
>         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;
>                 pool {
>                         # IP range to be assigned dynamically
>                         range 172.16.20.150 172.16.20.189;
>                 }
>                 pool {
>                         # IP ranges 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;
>                         host printer_1 {
>                                 hardware ethernet 00:11:22:33:44:55;
>                                 fixed-address 172.16.20.201;
>                         }
>                 }
>         }
> }
> 
> 
> Remember: My goal is to use dynamic and static specifications in same
> subnet, and also avoid this error message:
> Dynamic and static leases present for 172.16.20.201
> Remove host declaration printer_1 or remove 172.16.20.201

     The "shared-network" adds nothing with only one subnet but hurts
nothing. There is no problem with static and dynamic in the same subnet.
The issue is including the static IP addresses in your range statement.
To avoid the error, just do two (or three) range statements.

		> pool {
		>    range 172.16.20.190 172.16.20.200;
		>    range 172.16.20.202 172.16.20.255;
		>    ...
		> }

    Then put the host statements at the global scope level so they so not
accidentally inherit when they shouldn't.
-- 
Bruce A. Hudson				| Bruce.Hudson at Dal.CA
ITS, Networks and Systems		|
Dalhousie University			|
Halifax, Nova Scotia, Canada		| (902) 494-3405


More information about the dhcp-users mailing list