Advertisement
Guest User

Untitled

a guest
Aug 27th, 2021
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.48 KB | None | 0 0
  1. $ cat /etc/network/interfaces
  2. # network interface settings; autogenerated
  3. # Please do NOT modify this file directly, unless you know what
  4. # you're doing.
  5. #
  6. # If you want to manage parts of the network configuration manually,
  7. # please utilize the 'source' or 'source-directory' directives to do
  8. # so.
  9. # PVE will preserve these directives, but will NOT read its network
  10. # configuration from sourced files, so do not attempt to move any of
  11. # the PVE managed interfaces into external files!
  12.  
  13. auto lo
  14. iface lo inet loopback
  15.  
  16. iface eno2 inet manual
  17.  
  18. auto eno1
  19. allow-hotplug eno1
  20. iface eno1 inet dhcp
  21.         pre-up /etc/network/preup.sh
  22.         post-down /etc/network/postdown.sh
  23.  
  24.  
  25.  
  26. auto vmbr0
  27. iface vmbr0 inet static
  28.         address 172.31.1.25/16
  29.         bridge-ports eno2
  30.         bridge-stp off
  31.         bridge-fd 0
  32.         metric 10
  33.  
  34. #private sub network
  35. auto vmbr2
  36. iface vmbr2 inet static
  37.         address  192.168.1.1
  38.         netmask  255.255.255.0
  39.         bridge_ports none
  40.         bridge_stp off
  41.         bridge_fd 0
  42.         post-up echo 1 |  tee /proc/sys/net/ipv4/ip_forward
  43.         post-up   iptables -t nat -A POSTROUTING -s '192.168.1.0/24' -o eno1 -j MASQUERADE
  44.         post-down iptables -t nat -D POSTROUTING -s '192.168.1.0/24' -o eno1 -j MASQUERADE
  45. #       post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 1022 -j DNAT --to 192.168.1.57:22
  46. #       post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 1022 -j DNAT --to 192.168.1.57:22
  47. #
  48.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement