我正在尝试使用网络计划来建立一个网关。以下是我设置的一些细节:
iptables从enp5s0和br0设置为NAT (iptables -t nat -A POSTROUTING -o enp5s0 -j MASQUERADE)。已经设置了ip_forward=1内核参数。然而,我的结果好坏参半:
我的航路表是这样的:
Destination Gateway Genmask Flags Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG enp5s0
192.168.0.0 0.0.0.0 255.255.255.0 U enp5s0
192.168.1.0 0.0.0.0 255.255.255.0 U br0有什么想法可以让我做这件事吗?
发布于 2020-08-03 16:30:15
好的,我能够让它与下面的设置一起工作。我可能不需要像我那样多地设置路线,但它确实有效。
network:
version: 2
renderer: NetworkManager
ethernets:
enp5s0:
dhcp4: no
addresses: [192.168.0.50/24]
gateway4: 192.168.0.1
nameservers:
addresses: [8.8.8.8]
routes:
- to: 0.0.0.0/0
via: 192.168.0.1
enp4s0f1:
dhcp4: true
routes:
- to: 0.0.0.0/0
via: 192.168.0.1
enp4s0f0:
dhcp4: true
routes:
- to: 0.0.0.0/0
via: 192.168.0.1
enp3s0f1:
dhcp4: true
routes:
- to: 0.0.0.0/0
via: 192.168.0.1
enp3s0f0:
dhcp4: true
routes:
- to: 0.0.0.0/0
via: 192.168.0.1
bridges:
br0:
interfaces: [enp4s0f1, enp4s0f0, enp3s0f1, enp3s0f0]
addresses: [192.168.1.1/24]https://unix.stackexchange.com/questions/602481
复制相似问题