From 68b5ff7e9900a8452238683473d77308f5255524 Mon Sep 17 00:00:00 2001 From: Nyr Date: Tue, 10 Mar 2015 10:44:47 +0100 Subject: [PATCH] Revert "Cleaner port 53 setup" This reverts commit fb036d575b5a682bef7f237592ac428d7146f15c. --- openvpn-install.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index e8cc1bb..21716ad 100755 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -132,6 +132,7 @@ if [[ -e /etc/openvpn/server.conf ]]; then fi rm -rf /etc/openvpn rm -rf /usr/share/doc/openvpn* + sed -i '/--dport 53 -j REDIRECT --to-port/d' $RCLOCAL sed -i '/iptables -t nat -A POSTROUTING -s 10.8.0.0/d' $RCLOCAL echo "" echo "OpenVPN removed!" @@ -261,7 +262,8 @@ else esac # Listen at port 53 too if user wants that if [[ "$ALTPORT" = 'y' ]]; then - sed -i '/port 1194/a port 53' server.conf + iptables -t nat -A PREROUTING -p udp -d $IP --dport 53 -j REDIRECT --to-port $PORT + sed -i "1 a\iptables -t nat -A PREROUTING -p udp -d $IP --dport 53 -j REDIRECT --to-port $PORT" $RCLOCAL fi # Enable net.ipv4.ip_forward for the system if [[ "$OS" = 'debian' ]]; then