Skip to content

Instantly share code, notes, and snippets.

@z3nth10n
Created July 23, 2019 11:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save z3nth10n/55cf273a7c084ce4425f38390d04597f to your computer and use it in GitHub Desktop.
Save z3nth10n/55cf273a7c084ce4425f38390d04597f to your computer and use it in GitHub Desktop.
auto vmbr1
iface vmbr1 inet static
address 192.168.xx.xx
netmask 24
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 '192.168.xx.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '192.168.xx.0/24' -o vmbr0 -j MASQUERADE
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 80 -j DNAT --to 192.168.xx.10:80
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 80 -j DNAT --to 192.168.xx.10:80
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 2222 -j DNAT --to 192.168.xx.10:22
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 2222 -j DNAT --to 192.168.xx.10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment