Created
March 13, 2020 18:50
-
-
Save moredure/8a55af8c698ab46447e1a4ba6dd78eeb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Under bastion | |
| route add default gw $PRIVATE_GW | |
| # On Bastion | |
| iptables -t nat -A POSTROUTING -p tcp -o $PUBLIC_IF -j SNAT --to-source $ANCHOR_IP | |
| modprobe iptable_nat | |
| echo 1 > /proc/sys/net/ipv4/ip_forward | |
| iptables -t nat -A POSTROUTING -o $PUBLIC_IF -j MASQUERADE | |
| iptables -A FORWARD -i $PRIVATE_IF -j ACCEPT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment