我想在 Ubuntu 服务器上安装 DHCP 服务器来监听 10.0.0.1(内部网络)。我还需要在 Ubuntu 服务器上配置 OpenVPN 服务器(DHCP 将向 OpenVPN 客户端出租地址),因此我需要在桥接模式(br0)中桥接一个硬件接口(eth1)和一个虚拟接口(来自 OpenVPN 的 TAP)。
我应该把 DHCP 放在哪里监听(在 br0 还是在 eth1 上)?我是否应该在以下配置中放置网关(如果 DHCP 在该接口上监听)?
我有以下配置(/etc/network/interfaces):
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth2
iface eth2 inet dhcp
# Other interfaces - not used
#auto eth0
# Internal interface - is now in bridge
#auto eth1 iface eth1 inet static
# address 10.0.0.1
# netmask 255.255.0.0
# Bridge
auto br0
iface br0 inet static
#ip, netmask, gateway
address 10.0.0.1
netmask 255.255.0.0
#gateway 10.0.0.1
#network interfaces on which to enable the bridge
bridge_ports eth1
#optional configuration if the machine is VM
#bridge_fd 9
#bridge_hello 2
#bridge_maxage 12
#bridge_stp off
答案1
DHCP 需要在桥接接口上进行监听。