在dhcp数据包中,字段表示客户端硬件地址,但它与mac地址不同,例如" fa:16:3e:6f:1a:9d"。
如果我知道一个接口的mac地址" fa:16:3e:6f:1a:9d",如何用mac地址评估chaddr?
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| op (1) | htype (1) | hlen (1) | hops (1) |
+---------------+---------------+---------------+---------------+
| xid (4) |
+-------------------------------+-------------------------------+
| secs (2) | flags (2) |
+-------------------------------+-------------------------------+
| ciaddr (4) |
+---------------------------------------------------------------+
| yiaddr (4) |
+---------------------------------------------------------------+
| siaddr (4) |
+---------------------------------------------------------------+
| giaddr (4) |
+---------------------------------------------------------------+
| |
| chaddr (16) |
| |
| |
+---------------------------------------------------------------+
| |
| sname (64) |
+---------------------------------------------------------------+
| |
| file (128) |
+---------------------------------------------------------------+
| |
| options (variable) |
+---------------------------------------------------------------+
答案 0 :(得分:1)
请参阅https://www.ietf.org/rfc/rfc2131.txt
4.4.1 Initialization and allocation of network address
...
The client MUST include its hardware address in the 'chaddr'
field, if necessary for delivery of DHCP reply messages.
前六个字节包含硬件地址,其余为零。可以检查bootp / dhcp数据包的内容,例如在Linux中使用dhcpdump。