Skip to content

Instantly share code, notes, and snippets.

@sankars
Created March 16, 2018 15:23
Show Gist options
  • Save sankars/7663cbb3ab36326cdef2edde0d69ae1f to your computer and use it in GitHub Desktop.
Save sankars/7663cbb3ab36326cdef2edde0d69ae1f to your computer and use it in GitHub Desktop.
Port forwarding in AWS
sudo sysctl -w net.ipv4.ip_forward=1 ## make it permanent. /etc/sysctl.conf
sudo iptables -t nat -A PREROUTING -p tcp --dport 8001 -j DNAT --to-destination 172.20.19.192:10000
sudo iptables -t nat -A POSTROUTING -j MASQUERADE
sudo service iptables save
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment