This file contains 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
# 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 |