我有一个正在使用“仅主机适配器”的虚拟机。我禁用了 VirtualBox 的内置 DHCP 服务器。我已经安装isc-dhcp-server
在我的虚拟机管理程序上。然后我添加了子网
subnet 10.10.54.0 netmask 255.255.255.0 {
range 10.10.54.2 10.10.54.254;
option routers 10.10.54.1;
option domain-name-servers 8.8.8.8, 8.8.4.4;
default-lease-time 600;
max-lease-time 7200;
}
并为虚拟机添加了固定地址。
host 10-10-54-11 {
hardware ethernet 08:00:27:de:7e:cc;
fixed-address 10.10.54.11;
}
我的虚拟机有 MAC 地址08:00:27:de:7e:cc
。我正在尝试通过以下命令从我的虚拟机发送 DHCP 请求:nmap --script broadcast-dhcp-discover
。但是,当 DHCPd 收到为 VM 提供 IP 地址的请求时,DHCPd 显示完全不同的 MAC 地址,并且不发送固定地址
root@hypervisor:/etc/dhcp# systemctl status isc-dhcp-server
● isc-dhcp-server.service - ISC DHCP IPv4 server
Loaded: loaded (/lib/systemd/system/isc-dhcp-server.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2023-11-13 12:28:09 +05; 9min ago
Docs: man:dhcpd(8)
Main PID: 12274 (dhcpd)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/isc-dhcp-server.service
└─12274 dhcpd -user dhcpd -group dhcpd -f -4 -pf /run/dhcp-server/dhcpd.pid -cf /etc/dhcp/dhcpd.conf
Nov 13 12:28:09 hypervisor dhcpd[12274]: you want, please write a subnet declaration
Nov 13 12:28:09 hypervisor dhcpd[12274]: in your dhcpd.conf file for the network segment
Nov 13 12:28:09 hypervisor dhcpd[12274]: to which interface eth0 is attached. **
Nov 13 12:28:09 hypervisor dhcpd[12274]:
Nov 13 12:28:09 hypervisor dhcpd[12274]: Sending on Socket/fallback/fallback-net
Nov 13 12:28:09 hypervisor dhcpd[12274]: Server starting service.
Nov 13 12:28:14 hypervisor dhcpd[12274]: DHCPDISCOVER from de:ad:c0:de:ca:fe via vboxnet4
Nov 13 12:28:15 hypervisor dhcpd[12274]: DHCPOFFER on 10.10.54.3 to de:ad:c0:de:ca:fe via vboxnet4
Nov 13 12:32:39 hypervisor dhcpd[12274]: DHCPDISCOVER from de:ad:c0:de:ca:fe via vboxnet4
Nov 13 12:32:40 hypervisor dhcpd[12274]: DHCPOFFER on 10.10.54.3 to de:ad:c0:de:ca:fe via vboxnet4
这是一个错误吗?如何解决这个问题?