From fb036d575b5a682bef7f237592ac428d7146f15c Mon Sep 17 00:00:00 2001 From: Nyr Date: Mon, 16 Feb 2015 17:33:22 +0100 Subject: [PATCH] Cleaner port 53 setup --- openvpn-install.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index 21716ad..e8cc1bb 100755 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -132,7 +132,6 @@ 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!" @@ -262,8 +261,7 @@ else esac # Listen at port 53 too if user wants that if [[ "$ALTPORT" = 'y' ]]; then - 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 + sed -i '/port 1194/a port 53' server.conf fi # Enable net.ipv4.ip_forward for the system if [[ "$OS" = 'debian' ]]; then