Created
January 26, 2023 00:03
-
-
Save modaresimr/45623062afc2a0cdf1bd9f5247668cc4 to your computer and use it in GitHub Desktop.
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment