Skip to content

Instantly share code, notes, and snippets.

# 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