Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. # nano /etc/network/interfaces
  2.  
  3. auto lo
  4. iface lo inet loopback
  5.  
  6. auto ens3
  7. iface ens3 inet static
  8. address 1.2.3.4
  9. netmask x.x.x.x
  10. gateway 4.3.2.1
  11. post-up echo 1 > /proc/sys/net/ipv4/conf/ens3/proxy_arp
  12.  
  13. auto vmbr0 vmbr1
  14. #NAT sub network, not bridged
  15. #10.0.0.0/8
  16. #192.168.0.0/16 (192.168.0.0-192.168.255.255, one space)
  17. #192.168.0.0/
  18. iface vmbr0 inet static
  19. address 10.0.0.1
  20. netmask 255.0.0.0
  21. bridge_ports none
  22. bridge_stp off
  23. bridge_fd 0
  24. post-up echo 1 > /proc/sys/net/ipv4/ip_forward
  25. post-up iptables -t nat -A POSTROUTING -s '10.0.0.0/8' -o ens3 -j MASQUERADE
  26. post-down iptables -t nat -D POSTROUTING -s '10.0.0.0/8' -o ens3 -j MASQUERADE
  27.  
  28. #private sub network2
  29. #No Nat Subnetwork, Bridged
  30. iface vmbr1 inet static
  31. address 10.0.0.2
  32. netmask 255.0.0.0
  33. bridge_ports ens3
  34. bridge_stp off
  35. bridge_fd 0
  36. #add here each new Public IP for any Container
  37. #we need to tell here the Host to use the default gateway for this IP
  38. post-up route add 2.3.4.5 dev vmbr1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement