我想有一个小的dynamic地址部分和大多数客户端分配一个固定的IP地址。
我的dhcpd.conf看起来像这样:
use-host-decl-names on; authoritative; allow client-updates; ddns-updates on; # Einstellungen fuer DHCP leases default-lease-time 3600; max-lease-time 86400; lease-file-name "/var/lib/dhcpd/dhcpd.leases"; subnet 192.168.11.0 netmask 255.255.255.0 { ddns-updates on; pool { # IP range which will be assigned statically range 192.168.11.1 192.168.11.240; deny all clients; } pool { # small dynamic range range 192.168.11.241 192.168.11.254; # used for temporary devices } } group { host pc1 { hardware ethernet xx:xx:xx:xx:xx:xx; fixed-address 192.168.11.11; } }
池声明拒绝所有主机的动机来自ISC DHCPD主页http://www.isc.org/files/auth.html这将允许主机首先添加到networking,在那里他们将收到一个临时的IP从241-254地址范围,然后写一个明确的主机声明。 在下一次连接时,它会收到正确的configuration。
问题是我得到错误消息,192.168.11.13有一个dynamic和静态租约。 我有点困惑,因为我预计池声明否认所有客户端不会算作dynamic。
Dynamic and static leases present for 192.168.11.13. Remove host declaration pc1 or remove 192.168.11.13 from the dynamic address pool for 192.168.11.0/24
有一种方法让DHCP服务器发送一个DHCPNA给客户端,如果他们有一个主机语句,并保留这个dynamic范围?
configuration检查器只会将您定义的池和主机地址定义相互匹配以find定义交集,而不会评估访问列表。
所以你将不得不从“拒绝所有”池定义中明确地排除你的主机定义范围:
pool { # IP range which will be assigned statically range 192.168.11.1 192.168.11.10 range 192.168.1.12 192.168.11.240; deny all clients; }