Skip to content

Instantly share code, notes, and snippets.

@micoli
Created December 9, 2019 22:08
Show Gist options
  • Save micoli/6a3dfc0b58d430acecbc5b422a8bca9e to your computer and use it in GitHub Desktop.
Save micoli/6a3dfc0b58d430acecbc5b422a8bca9e to your computer and use it in GitHub Desktop.
#!/bin/bash
iptables -t filter -A FORWARD -o vmbr2 -j ACCEPT
iptables -t filter -A FORWARD -i vmbr2 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o vmbr2 -j MASQUERADE
iptables -t nat -A PREROUTING -p tcp -d external.public.ip --dport 5000 -i vmbr0 -j DNAT --to-destination 10.8.1.2:5000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment