可以使用 Src Mac 地址区分来自多个主机的 DHCP 请求。那么,为什么需要 DHCP 客户端 ID 来区分 DHCP 请求。我知道他们需要一些 IP 地址,因为 DHCP 在应用层工作。因此,目标 IP 地址可以是 255.255.255.255。对于 DHCP 客户端,src IP 将为 0.0.0.0。但是,可以通过 mac 地址轻松区分请求。因此,他们真的不需要DHCP客户端ID吗?
为什么 DHCP 协议需要 Client ID?
网络工程
dhcp
2021-07-25 09:55:17
2个回答
DHCP defines a new 'client identifier' option that is used to pass an
explicit client identifier to a DHCP server. This change eliminates
the overloading of the 'chaddr' field in BOOTP messages, where
'chaddr' is used both as a hardware address for transmission of BOOTP
reply messages and as a client identifier. The 'client identifier'
is an opaque key, not to be interpreted by the server; for example,
the 'client identifier' may contain a hardware address, identical to
the contents of the 'chaddr' field, or it may contain another type of
identifier, such as a DNS name. The 'client identifier' chosen by a
DHCP client MUST be unique to that client within the subnet to which
the client is attached. If the client uses a 'client identifier' in
one message, it MUST use that same identifier in all subsequent
messages, to ensure that all servers correctly identify the client.
它允许客户端指定 MAC 以外的内容。
RFC 2132 第 9.14 节定义了 Client-Identifier 选项。
在我看来,这对于支持 DHCP 中继是绝对必要的。在 DHCP 中继中,源 IP 和目标 IP 被更改。此外,源和目标 mac 地址。因此,在从 dhcp 服务器接收 dhcp 消息时,中继接口无法跟踪 mac 地址。事实上,它只会将数据包转发到没有准确目标 mac 地址的广播 IP。在客户端 ID 的帮助下,DHCP 客户端可以了解数据包是否是给他们的。