为什么 udhcpd 不响应 DHCP 请求?

为什么 udhcpd 不响应 DHCP 请求?

udhcpd.conf我正在尝试配置地址为 192.168.100.30 的 DHCP 服务器。这是文件的内容:

# Sample udhcpd configuration file (/etc/udhcpd.conf)

# The start and end of the IP lease block

start       192.168.100.25  #default: 192.168.0.20
end         192.168.100.29  #default: 192.168.0.254


# The interface that udhcpd will use

interface   eth0        #default: eth0


# The maximim number of leases (includes addressesd reserved
# by OFFER's, DECLINE's, and ARP conficts

#max_leases 254     #default: 254


#Examles
opt dns 8.8.8.8
option  subnet  255.255.255.240
opt router  192.168.100.30
option  dns 8.8.8.4     # appened to above DNS servers for a total of 3
option  domain  local
option  lease   864000      # 10 days of seconds

然后如果在另一台机器上我运行

dhclient -v -d -s 192.168.100.30 eth0

结果是

/# dhclient -v -d -s 192.168.100.30 eth0
Internet Systems Consortium DHCP Client 4.3.5
Copyright 2004-2016 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/b6:60:eb:02:f7:c1
Sending on   LPF/eth0/b6:60:eb:02:f7:c1
Sending on   Socket/fallback
DHCPDISCOVER on eth0 to 192.168.100.30 port 67 interval 8
DHCPDISCOVER on eth0 to 192.168.100.30 port 67 interval 9
DHCPDISCOVER on eth0 to 192.168.100.30 port 67 interval 13

在服务器上使用 tcpdump 我可以看到它收到了请求,因此客户端似乎可以工作。不管怎样,服务器不回复请求。知道如何修复它吗?

答案1

由于您的客户端还没有任何 IPv4,因此-s <ip>作为dhclient选项无法工作。

相关内容