实验环境:
DHCP Server:
系统Ubuntu 10.04 , DHCP Server : dnsmasq
DHCP Relay:
系统Ubuntu 10.04, DHCP Relay为WiMAX网关。
现象:
(1) Win XP收到DHCP Offer,没有响应。
(2) Ubuntu下客户端能够正常获得IP地址。
在多次尝试后,并查看外国网站上的文章。最后了解到。Linux下,和XP上的DHCP实现是有些不同的。
Frame 13 (342 bytes on wire, 342 bytes captured)
Ethernet II, Src: Intel_c1:3a:11 (00:04:23:c1:3a:11), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Internet Protocol, Src: 192.168.130.1 (192.168.130.1), Dst: 255.255.255.255 (255.255.255.255)
User Datagram Protocol, Src Port: 10426 (10426), Dst Port: bootpc (68)
Bootstrap Protocol
Message type: Boot Reply (2)
Hardware type: Ethernet
Hardware address length: 6
Hops: 0
Transaction ID: 0x6fabf38e
Seconds elapsed: 0
Bootp flags: 0x0000 (Unicast)
Client IP address: 0.0.0.0 (0.0.0.0)
Your (client) IP address: 192.168.130.100 (192.168.130.100)
Next server IP address: 192.168.66.52 (192.168.66.52)
Relay agent IP address: 192.168.130.253 (192.168.130.253)
Client MAC address: Dell_58:b6:36 (00:15:c5:58:b6:36)
Server host name not given
Boot file name not given
Magic cookie: (OK)
Option: (t=53,l=1) DHCP Message Type = DHCP Offer
Option: (t=1,l=4) Subnet Mask = 255.255.255.0
Option: (t=58,l=4) Renewal Time Value = 4 days
Option: (t=59,l=4) Rebinding Time Value = 7 days
Option: (t=51,l=4) IP Address Lease Time = 8 days
Option: (t=54,l=4) Server Identifier = 192.168.66.52
Option: (t=15,l=7) Domain Name = "abc.com"
Option: (t=3,l=4) Router = 192.168.130.1
Option: (t=6,l=8) Domain Name Server
End Option
Padding
如上的消息,在Win XP中,客户端接收到消息后,将不会做任何反应。
因为Win XP判断比较严格,必须按照RFC2131标准的消息格式,客户端才会接收DHCP消息。
如上消息的三个红色的地方必须是一致的。
即:
Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Dst: 255.255.255.255 (255.255.255.255)
Bootp flags: 0x8000 (Broadcast)
或
Dst: Broadcast (11:22:33:44:55:)
Dst: 192.168.1.172 (192.168.1.172)
Bootp flags: 0x0000 (Unicast)
这两种中的一种,才会被Win XP所接收.