From aefb5169584907f4cf612791ed3c8b9abe47d645 Mon Sep 17 00:00:00 2001 From: Angristan Date: Tue, 4 Oct 2016 17:31:35 +0200 Subject: [PATCH] Changed iptables to not lookup hosts https://github.com/Nyr/openvpn-install/commit/56f079289e8f5236ec9dc08a5331d90835b3fd0c --- openvpn-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index df8252f..9a31820 100644 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -147,7 +147,7 @@ if [[ -e /etc/openvpn/server.conf ]]; then firewall-cmd --zone=trusted --remove-masquerade firewall-cmd --permanent --zone=trusted --remove-masquerade fi - if iptables -L | grep -qE 'REJECT|DROP'; then + if iptables -L -n | grep -qE 'REJECT|DROP'; then sed -i "/iptables -I INPUT -p udp --dport $PORT -j ACCEPT/d" $RCLOCAL sed -i "/iptables -I FORWARD -s 10.8.0.0\/24 -j ACCEPT/d" $RCLOCAL sed -i "/iptables -I FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT/d" $RCLOCAL @@ -406,7 +406,7 @@ tls-auth tls-auth.key 0" >> /etc/openvpn/server.conf sed -ie 's/^DEFAULT_FORWARD_POLICY\s*=\s*/DEFAULT_FORWARD_POLICY="ACCEPT"\n#before openvpn: /' /etc/default/ufw fi fi - if iptables -L | grep -qE 'REJECT|DROP'; then + if iptables -L -n | grep -qE 'REJECT|DROP'; then # If iptables has at least one REJECT rule, we asume this is needed. # Not the best approach but I can't think of other and this shouldn't # cause problems.