我安装了一个 DHCP 服务器(yum install dhcp
),这是我的配置:
# create new
# specify domain name
option domain-name "mydomain.name";
# specify DNS's hostname or IP address
option domain-name-servers 10.0.1.1, 10.0.1.2;
option ntp-servers 10.0.1.1, 10.0.1.2;
allow unknown-clients;
# default lease time
default-lease-time 2628000;
# max lease time
max-lease-time 2628000; # about a month
# this DHCP server to be declared valid
authoritative;
# specify network address and subnet mask
subnet 10.0.0.0 netmask 255.0.0.0 {
# specify the range of lease IP address
range dynamic-bootp 10.0.2.1 10.0.2.50;
# specify broadcast address
option broadcast-address 10.255.255.255;
# specify default gateway
option routers 10.0.0.1;
allow unknown-clients;
}
service dhcpd start
报告[ OK ]
。但是,如果我禁用其他 DHCP 服务器 (Win2k3) 并让客户端尝试续订其 IP 租约,则会超时。
所以我安装了dhcping
。无论我尝试什么选项,包括将 dhcping 定向到我的服务器、在范围内添加客户端地址、添加我的硬件地址,它都会回复“无答案”。我也在尝试,-i
因为这似乎更类似于 WinXP 客户端会尝试做的事情,基于/var/log/messages
。它将尝试(来自sudo dhcping -V -i -s 255.255.255.255 -c 10.0.2.15 -h 00:11:25:66:4e:7f
此处)记录为:
Oct 24 18:55:13 newdc dhcpd: DHCPINFORM from 10.0.2.15 via eth0
Oct 24 18:55:13 newdc dhcpd: DHCPACK to 10.0.2.15 (00:11:25:66:4e:7f) via eth0
然而客户端(在 DHCP 服务器上运行)却说:
setup
inform
packet 247 bytes
01 01 06 00 77 48 6a 52 00 00 00 00 0a 00 02 08
00 00 00 00 00 00 00 00 00 00 00 00 00 1f 29 e1
aa 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 63 82 53 63
35 01 08 37 01 01 ff
op: 1
htype: 1
hlen: 6
hops: 0
xid: 77486a52
secs: 0
flags: 0
ciaddr: 10.0.2.8
yiaddr: 0.0.0.0
siaddr: 0.0.0.0
giaddr: 0.0.0.0
chaddr: 00:1f:29:e1:aa:14:00:00:00:00:00:00:00:00:00:00
sname : .
fname : .
option 53 DHCP message type
DHCP message type: 8 (DHCPINFORM)
option 55
no answer
close
没有回复?听起来好像已经发出去了……
这是/etc/sysconfig/dhcpd
限制eth0
并iptables
停止的。
更新:奇怪的是,WinXP 客户端似乎已使用此设置成功租用了 IP。dhcping
那么,为什么会失败,不管有没有-i
?这让它作为测试工具毫无用处……