我的 DHCP 服务器忽略了特定客户端的 DHCP 请求。使用主机控制器(提供 DHCP 服务的地方)中的 tcpdump,我可以看到请求
21:50:12.909484 IP (tos 0x0, ttl 255, id 1319, offset 0, flags [none],
proto UDP (17), length 336)
169.254.33.8.bootpc > 255.255.255.255.bootps: [udp sum ok]
BOOTP/DHCP, Request from 20:b0:f7:04:36:f0 (oui Unknown), length 308,
xid 0x5851f42d, Flags [none] (0x0000)
Client-Ethernet-Address 20:b0:f7:04:36:f0 (oui Unknown)
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Discover
MSZ Option 57, length 2: 1486
Parameter-Request Option 55, length 4:
Subnet-Mask, Default-Gateway, BR, Domain-Name-Server
END Option 255, length 0
PAD Option 0, length 0, occurs 54
看来,如果客户端的 IP 是 0.0.0.0 而不是 169.254.33.8,我只能为其提供地址
我的界面文件是这样的
auto eth0
iface eth0 inet static
address 10.78.0.1
netmask 255.255.255.0
我的 udhcpd.conf 如下所示:
# The start and end of the IP lease block
start 10.78.0.2
end 10.78.0.200
# The interface that udhcpd will use
interface eth0
opt dns 8.8.8.8 8.8.4.4 #public google dns servers
option subnet 255.255.255.0
opt router 10.78.0.1
option lease 864000 # default: 10 days
# Arbitrary option in hex form:
option 0x08 01020304 # option 8: "cookie server IP addr: 1.2.3.4"
我不确定这里的问题是什么。你们能给我一些想法吗?