Skip to content

Instantly share code, notes, and snippets.

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 modaresimr/45623062afc2a0cdf1bd9f5247668cc4 to your computer and use it in GitHub Desktop.
Save modaresimr/45623062afc2a0cdf1bd9f5247668cc4 to your computer and use it in GitHub Desktop.
# Run IPTABLES in your host
iptables -t nat -A PREROUTING -p tcp -s 172.17.0.2 --dport 25 -j DNAT --to-destination relayip:10000
# Run the following in your relay server
echo 1> /proc/sys/net/ipv4/conf/eth0/forwarding
iptables -t nat -A INPUT -p tcp --dport 10000 -j DNAT --to-destination ip_of_gmail:25
iptables -t nat -A -p tcp -d ip_of_gmail --dport 25 -j MASQUERADE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment