我在一台机器上安装了isc-dhcp-server,并配置为发送wpad地址:
option local-proxy-config code 252 = text;
subnet 192.168.1.0 netmask 255.255.255.0 {
## dhcp start and end IP range ##
range 192.168.1.140 192.168.1.144;
option local-proxy-config "http://www.example.org/proxy.pac";
option subnet-mask 255.255.255.0; ## subnet
option broadcast-address 192.168.1.255; ## broadcast
option routers 192.168.1.1; ## router IP
}
然后执行 dhcpd -t 并重新启动服务器,然后我想从另一台机器测试该选项,因此我使用了 dhcping:
sudo dhcping -iV -s 192.168.1.98 -h 01:02:03:04
这给了我:
op: 2
htype: 1
hlen: 4
hops: 0
xid: b8990b59
secs: 0
flags: 0
ciaddr: 0.0.0.0
yiaddr: 0.0.0.0
siaddr: 192.168.1.98
giaddr: 0.0.0.0
chaddr: 01:02:03:04:00:00:00:00:00:00:00:00:00:00:00:00
sname : .
fname : .
option 53 DHCP message type
DHCP message type: 5 (DHCPACK)
option 54 Server identifier
Server identifier: 192.168.1.98
option 1 Subnet mask
Subnet mask: 255.255.255.0
close
服务器没有记录任何警告或其他信息:
May 5 01:12:43 node2 dhcpd: DHCPACK to 192.168.1.251 (01:02:03:04) via eth0
May 5 01:14:31 node2 dhcpd: DHCPINFORM from 192.168.1.251 via eth0
谁能告诉我为什么我没有得到 252 选项?
答案1
默认情况下,客户端必须请求服务器发送该选项。
您可以在 dhcpd.conf 文件中使用这些行来强制使用某些选项:
if exists dhcp-parameter-request-list {
option dhcp-parameter-request-list = concat(option dhcp-parameter-request-list,fc);
}
注意:代码 252 = 0xfc