我在 上创建了两个子接口eth0
:
eth0:0
带IP 192.168.10.1/24
eth0:1
带IP 192.168.11.1/24
/etc/dhcp/dhcpd.conf
像这样配置:
option domain-name-server 194.204.159.1;
subnet 192.168.10.0 netmask 255.255.255.0 {
option routers 192.168.10.1;
option subnet-mask 255.255.255.0;
range 192.168.10.10 192.168.10.100;
}
subnet 192.168.11.0 netmask 255.255.255.0 {
option routers 192.168.11.1;
option subnet-mask 255.255.255.0;
range 192.168.11.10 192.168.11.100;
}
Run Code Online (Sandbox Code Playgroud)
但是当我尝试启动 DHCP 服务器时,我得到:
No subnet declaration for eth0:0 (no IPv4 addresses).
** Ignoring requests on eth0:0. If this is not what
you want, please write a subnet declaration
in your dhcpd.conf file for the network …
Run Code Online (Sandbox Code Playgroud)