Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # nano /etc/network/interfaces
- auto lo
- iface lo inet loopback
- auto ens3
- iface ens3 inet static
- address 1.2.3.4
- netmask x.x.x.x
- gateway 4.3.2.1
- post-up echo 1 > /proc/sys/net/ipv4/conf/ens3/proxy_arp
- auto vmbr0 vmbr1
- #NAT sub network, not bridged
- #10.0.0.0/8
- #192.168.0.0/16 (192.168.0.0-192.168.255.255, one space)
- #192.168.0.0/
- iface vmbr0 inet static
- address 10.0.0.1
- netmask 255.0.0.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.0.0.0/8' -o ens3 -j MASQUERADE
- post-down iptables -t nat -D POSTROUTING -s '10.0.0.0/8' -o ens3 -j MASQUERADE
- #private sub network2
- #No Nat Subnetwork, Bridged
- iface vmbr1 inet static
- address 10.0.0.2
- netmask 255.0.0.0
- bridge_ports ens3
- bridge_stp off
- bridge_fd 0
- #add here each new Public IP for any Container
- #we need to tell here the Host to use the default gateway for this IP
- post-up route add 2.3.4.5 dev vmbr1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement