mirror of
https://github.com/angristan/openvpn-install.git
synced 2024-11-22 16:59:03 +01:00
uninstall new firewalld rules
This commit is contained in:
parent
a420a6cbcd
commit
4a07541953
@ -137,13 +137,14 @@ if [[ -e /etc/openvpn/server.conf ]]; then
|
|||||||
ufw delete allow $PORT/udp
|
ufw delete allow $PORT/udp
|
||||||
sed -i '/^##OPENVPN_START/,/^##OPENVPN_END/d' /etc/ufw/before.rules
|
sed -i '/^##OPENVPN_START/,/^##OPENVPN_END/d' /etc/ufw/before.rules
|
||||||
sed -i 's/^DEFAULT_FORWARD_POLICY="ACCEPT" #before ovpn: /DEFAULT_FORWARD_POLICY=/g' /etc/default/ufw
|
sed -i 's/^DEFAULT_FORWARD_POLICY="ACCEPT" #before ovpn: /DEFAULT_FORWARD_POLICY=/g' /etc/default/ufw
|
||||||
fi
|
elif pgrep firewalld; then
|
||||||
if pgrep firewalld; then
|
|
||||||
# Using both permanent and not permanent rules to avoid a firewalld reload.
|
# Using both permanent and not permanent rules to avoid a firewalld reload.
|
||||||
firewall-cmd --zone=public --remove-port=$PORT/udp
|
firewall-cmd --zone=public --remove-port=$PORT/udp
|
||||||
firewall-cmd --zone=trusted --remove-source=10.8.0.0/24
|
firewall-cmd --zone=trusted --remove-source=10.8.0.0/24
|
||||||
firewall-cmd --permanent --zone=public --remove-port=$PORT/udp
|
firewall-cmd --permanent --zone=public --remove-port=$PORT/udp
|
||||||
firewall-cmd --permanent --zone=trusted --remove-source=10.8.0.0/24
|
firewall-cmd --permanent --zone=trusted --remove-source=10.8.0.0/24
|
||||||
|
firewall-cmd --zone=trusted --remove-masquerade
|
||||||
|
firewall-cmd --permanent --zone=trusted --remove-masquerade
|
||||||
fi
|
fi
|
||||||
if iptables -L | grep -qE 'REJECT|DROP'; then
|
if iptables -L | grep -qE 'REJECT|DROP'; then
|
||||||
sed -i "/iptables -I INPUT -p udp --dport $PORT -j ACCEPT/d" $RCLOCAL
|
sed -i "/iptables -I INPUT -p udp --dport $PORT -j ACCEPT/d" $RCLOCAL
|
||||||
|
Loading…
Reference in New Issue
Block a user