cd /etc/network
cp interfaces interfacesbak
nano /etc/network/interfaces
移除 rename4 與 rename5 的設定,以便 network-manager 管理
auto lo
iface lo inet loopback
iface eno1 inet manual
auto vmbr0
iface vmbr0 inet static
address 120.115.3.32
netmask 255.255.255.0
gateway 120.115.3.253
bridge_ports eno1
bridge_stp off
bridge_fd 0
iface eno2 inet manual
service network-manager restart
auto vmbr1
#private sub network
iface vmbr1 inet static
address 10.10.10.1
netmask 255.255.255.0
bridge_ports none
bridge_stp off
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o bond0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o bond0 -j MASQUERADE