無線網路與nat設定

auto lo
iface lo inet loopback

iface enp5s0 inet manual

auto wlp4s0
iface wlp4s0 inet manual
	wpa-ssid redmi
	wpa-psk password

auto vmbr0
iface vmbr0 inet static
	address 120.115.4.162
	netmask 255.255.255.0
	gateway 120.115.4.253
	bridge_ports enp5s0
	bridge_stp off
	bridge_fd 0
#auto vmbr0
#iface vmbr0 inet manual
#	bridge_ports wlp4s0
#	bridge_stp off
#	bridge_fd 0
auto vmbr1
iface vmbr1 inet static
    address 10.99.0.254
    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.99.0.0/24' -j MASQUERADE
    post-down iptables -t nat -D POSTROUTING -s '10.99.0.0/24' -j MASQUERADE
    post-up iptables -t nat -A PREROUTING  -p tcp --dport 1022 -j DNAT --to 10.99.0.1:22
    post-down iptables -t nat -D PREROUTING  -p tcp --dport 1022 -j DNAT --to 10.99.0.1:22

Last updated