在我的研究实验室中,我将我的电脑连接到以太网端口墙上插座,并获得以下 IP 分配
192.168.1.X/24 网关:192.168.1.1
但如果我将独立的流氓 wifi 路由器的 wan 端口连接到同一插座,我会得到不同的 IP 网络配置
192.168.29.X/24 网关:192.168.29.1
PC 和路由器之间的 DHCP DISCOVER 广播有什么不同吗?DHCP 服务器究竟如何区分这两者?还是我完全搞错了?
答案1
DHCP 服务器可能会根据 MAC 地址提供 IP
subnet 192.0.2.0 netmask 255.255.255.0 {
option routers 192.0.2.1;
# Unknown clients get this pool.
pool {
option domain-name-servers bogus.example.com;
max-lease-time 300;
range 192.0.2.200 192.0.2.253;
allow unknown-clients;
}
# Known clients get this pool.
pool {
option domain-name-servers ns1.example.com, ns2.example.com;
max-lease-time 28800;
range 192.0.2.5 192.0.2.199;
deny unknown-clients;
}
}
host myhost1 { hardware ethernet 01:23:45:00:00:01; }
host myhost2 { hardware ethernet 01:23:45:00:00:02; }
host myhost3 { hardware ethernet 01:23:45:00:00:03; }