![ubuntu 服务器 DHCP 服务器两个接口-如何?](https://linux22.com/image/1196163/ubuntu%20%E6%9C%8D%E5%8A%A1%E5%99%A8%20DHCP%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%A4%E4%B8%AA%E6%8E%A5%E5%8F%A3-%E5%A6%82%E4%BD%95%EF%BC%9F.png)
嗨,我在 Ubuntu 服务器上遇到了 DHCP 服务器问题,该服务器是在 rasbery pi 上配置的。设备有两个网络接口 wlan0 - 手机和 eth0 上的互联网。问题是 eth0 不工作,没有互联网,这个接口无法向客户端提供 ip 地址。我的配置:yaml 文件
network:
ethernets:
eth0:
dhcp4: no
addresses:
- 192.168.222.1/24
routes:
- to: 0.0.0.0/0
via: 192.168.222.1
metric: 50
nameservers:
addresses: [8.8.8.8, 1.1.1.1]
optional: true
version: 2
renderer: NetworkManager
wifis:
wlan0:
optional: true
access-points:
"Galaxy S101e88":
password: "somepassword"
dhcp4: true
isc-dhcp-server(如果我尝试将接口更改为 eth0,DHCP 服务器就会出现错误)
INTERFACESv4="wlan0"
dhcpd配置文件
# A slightly different configuration for an internal subnet.
subnet 192.168.222.0 netmask 255.255.255.0 {
range 192.168.222.5 192.168.222.254;
option domain-name-servers ns1.internal.example.org;
option domain-name "internal.example.org";
option subnet-mask 255.255.255.0;
option routers 192.168.222.1;
option broadcast-address 192.168.222.255;
default-lease-time 600;
max-lease-time 7200;
}