Last active
August 29, 2015 14:00
-
-
Save danielholmstrom/11372057 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
#!/bin/bash | |
# Setup iptables and save them | |
iptables --flush | |
iptables --flush -t nat | |
# Forward all ports to openvpn server | |
iptables -t nat -A PREROUTING -d {{ public_openvpn_ip }} -p udp --match multiport --dport 2:1193 -j DNAT --to-destination :1194 | |
iptables -t nat -A PREROUTING -d {{ public_openvpn_ip }} -p udp --match multiport --dport 1195:65535 -j DNAT --to-destination :1194 | |
# Save rules | |
iptables-save > /etc/iptables.up.rules |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment