Last active
September 20, 2017 08:39
-
-
Save ruslanbogun/82093867b357864897f301d781688220 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
Amazon provides Amazon Linux AMIs that are configured to run as NAT instances. These AMIs include the string amzn-ami-vpc-nat in their names, so you can search for them in the Amazon EC2 console. | |
redirect from NAT to private net | |
sudo iptables -t nat -A PREROUTING -p tcp --dport 10234 -j DNAT --to-destination 10.0.1.234:22 | |
sudo iptables -A POSTROUTING -t nat -s 10.0.1.0/24 -j MASQUERADE | |
sudo /etc/init.d/iptables save | |
list | |
sudo iptables -t nat -L -n -v | |
sudo iptables -t nat -v -L PREROUTING -n --line-number | |
delete | |
sudo iptables -t nat -D PREROUTING 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment