我在 Ubuntu 18.04 上运行isc-dhcp-server
。没有 DHCP 预留的客户端能够毫无问题地从池中获取 IP 地址、子网掩码、默认网关和 DNS 服务器。
一旦我定义保留,客户端将正确获取保留的 IP 地址、子网掩码和 DNS 服务器,但是默认网关将会丢失,如此屏幕截图所示。
这是我的 dhcpd.conf 文件,供参考。
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;
}