Last active
July 16, 2018 12:34
-
-
Save arastu/8d2986afa21abd826979b374398fc92f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# client ----> 1.1.1.1 --------> 2.2.2.2 | |
# (relay) (dest) | |
sudo iptables -A FORWARD -d 2.2.2.2 -i ens160 -p udp -m udp --dport 500:500 -j ACCEP | |
sudo iptables -A FORWARD -d 2.2.2.2 -i ens160 -p udp -m udp --dport 4500:4500 -j ACCEPT | |
sudo iptables -t nat -A PREROUTING -d 1.1.1.1 -p udp -m udp --dport 500:500 -j DNAT --to-destination 2.2.2.2 | |
sudo iptables -t nat -A PREROUTING -d 1.1.1.1 -p udp -m udp --dport 4500:4500 -j DNAT --to-destination 2.2.2.2 | |
sudo iptables -t nat -A POSTROUTING -o ens160 -j MASQUERADE | |
sudo ufw allow 500/udp | |
sudo ufw allow 4500/udp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment