source /etc/network/interfaces.d/*
auto lo
iface lo inet loopback
iface lo inet6 loopback
# 注意下面的enp3s0改成你自己母鸡的网口名字,默认的配置文件里有,或者用ifconfig命令查看
iface enp3s0 inet manual
iface enp3s0 inet6 manual
auto vmbr0
iface vmbr0 inet static
#母鸡ip,下面的掩码和网关默认配置里有,或者可以去Hetzner的后台,将鼠标放在ip上,会显示
address 144.76.xxx.xxx
#母鸡掩码
netmask 255.255.255.224
#母鸡网关
gateway 144.76.xxx.xxx
# 注意修改enp3s0
bridge_ports enp3s0
bridge_stp off
bridge_fd 0
bridge_maxwait 0
#这里做内网桥接
auto vmbr1
iface vmbr1 inet static
address 192.168.1.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 '192.168.1.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '192.168.1.0/24' -o vmbr0 -j MASQUERADE
iface vmbr0 inet6 static
#母鸡的ipv6地址
address 2a01:4f8:123:1234::2
netmask 64
gateway fe80::1
#注意修改enp3s0
bridge_ports enp3s0
bridge_stp off
bridge_fd 0