如何在 ubuntu 上設定 isc dhcp 為遠端網路提供租用

如何在 ubuntu 上設定 isc dhcp 為遠端網路提供租用

我正在PCisc dhcp上配置伺服器ubuntu 16.04。 DHCP 伺服器需要向不同網路上的用戶端提供 DHCP 租用。這是因為,客戶端將透過結合IP中繼的VPN連接

當我配置 DHCP 伺服器並運行它時,出現錯誤:

- Not configured to listen on any interfaces!

下面線程中的答案提到 isc dhcp 將此類配置標記為錯誤並且不會啟動它。有可能使這項工作成功嗎?

https://unix.stackexchange.com/questions/415888/cant-start-isc-dhcp-server-because-of-the-error-not-configured-to-listen-on-a

我的設置的詳細信息

dhcp 伺服器上 ifconfig 的部分輸出:

enp0s25   Link encap:Ethernet  HWaddr 64:00:6a:95:9c:2e  
          inet addr:192.168.168.200  Bcast:192.168.168.255  Mask:255.255.255.0

/etc/default/isc-dhcp-伺服器:

INTERFACES="enp0s25"
INTERFACESv4="enp0s25"

/etc/dhcp/dhcpd.conf:

subnet 192.168.2.0 netmask 255.255.255.0 {
 range 192.168.2.102 192.168.2.254;
 option domain-name-servers ubuntuserver.ostechnix.lan;
 option domain-name "ostechnix.lan";
 option routers 192.168.2.101;
 option broadcast-address 192.168.2.255;
 default-lease-time 600;
 max-lease-time 7200;
 }

答案1

我遇到錯誤,例如“ No subnet declaration for eth1”和“ Not configured to listen on any interfaces!”。

然後我在儘管子網不租用地址的情況下添加eth1(與 相同enp0s25)聲明。它起作用了。subnetdhcpd.conf

嘗試新增此配置:

subnet 192.168.168.0 netmask 255.255.255.0 {
    option routers 192.168.168.1;
}

參考自:Ubuntu - dhcp 伺服器“未配置為偵聽任何介面”

相關內容