echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
sysctl -p
nano /etc/network/interfaces
auto lo
iface lo inet loopback

auto nic0
iface nic0 inet manual

auto nic1
iface nic1 inet manual

#WAN
auto vmbr0
iface vmbr0 inet static
        address 192.168.1.178/24
        gateway 192.168.1.1
        bridge-ports nic1
        bridge-stp off
        bridge-fd 0

#LAN
auto vmbr1
iface vmbr1 inet static
        address 192.168.10.200/24
        bridge-ports nic0
        bridge-stp off
        bridge-fd 0
        post-up iptables -t nat -A POSTROUTING -s '192.168.10.0/24' -o vmbr0 -j MASQUERADE
        post-down iptables -t nat -D POSTROUTING -s '192.168.10.0/24' -o vmbr0 -j MASQUERADE

source /etc/network/interfaces.d/*

 

Restart systemu

ifreload -a

Spis treści: