mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-20 03:40:17 +00:00
Fixes for UFW
This commit is contained in:
parent
f0d92ab8df
commit
0fbc99e0b7
2 changed files with 8 additions and 0 deletions
|
@ -495,6 +495,9 @@ setCustomPort() {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
# write out the port
|
||||||
|
echo ${PORT} > /tmp/INSTALL_PORT
|
||||||
|
$SUDO cp /tmp/INSTALL_PORT /etc/pivpn/INSTALL_PORT
|
||||||
}
|
}
|
||||||
|
|
||||||
setClientDNS() {
|
setClientDNS() {
|
||||||
|
@ -771,6 +774,8 @@ confNetwork() {
|
||||||
$SUDO sed -i 's/IPv4dev/'$IPv4dev'/' /tmp/ufw_add.txt
|
$SUDO sed -i 's/IPv4dev/'$IPv4dev'/' /tmp/ufw_add.txt
|
||||||
$SUDO sed -i "s/\(DEFAULT_FORWARD_POLICY=\).*/\1\"ACCEPT\"/" /etc/default/ufw
|
$SUDO sed -i "s/\(DEFAULT_FORWARD_POLICY=\).*/\1\"ACCEPT\"/" /etc/default/ufw
|
||||||
$SUDO sed -i -e '/delete these required/r /tmp/ufw_add.txt' -e//N /etc/ufw/before.rules
|
$SUDO sed -i -e '/delete these required/r /tmp/ufw_add.txt' -e//N /etc/ufw/before.rules
|
||||||
|
$SUDO ufw allow ${PORT}/udp
|
||||||
|
$SUDO ufw allow from 10.8.0.0/24
|
||||||
$SUDO ufw reload
|
$SUDO ufw reload
|
||||||
echo "::: UFW configuration completed."
|
echo "::: UFW configuration completed."
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -19,6 +19,7 @@ fi
|
||||||
INSTALL_USER=$(cat /etc/pivpn/INSTALL_USER)
|
INSTALL_USER=$(cat /etc/pivpn/INSTALL_USER)
|
||||||
PLAT=$(cat /etc/pivpn/DET_PLATFORM)
|
PLAT=$(cat /etc/pivpn/DET_PLATFORM)
|
||||||
NO_UFW=$(cat /etc/pivpn/NO_UFW)
|
NO_UFW=$(cat /etc/pivpn/NO_UFW)
|
||||||
|
PORT=$(cat /etc/pivpn/INSTALL_PORT)
|
||||||
|
|
||||||
# Find the rows and columns
|
# Find the rows and columns
|
||||||
rows=$(tput lines)
|
rows=$(tput lines)
|
||||||
|
@ -103,6 +104,8 @@ echo ":::"
|
||||||
if [[ $NO_UFW -eq 0 ]]; then
|
if [[ $NO_UFW -eq 0 ]]; then
|
||||||
$SUDO sed -i "s/\(DEFAULT_FORWARD_POLICY=\).*/\1\"DROP\"/" /etc/default/ufw
|
$SUDO sed -i "s/\(DEFAULT_FORWARD_POLICY=\).*/\1\"DROP\"/" /etc/default/ufw
|
||||||
$SUDO sed -i '/START OPENVPN RULES/,/END OPENVPN RULES/ d' /etc/ufw/before.rules
|
$SUDO sed -i '/START OPENVPN RULES/,/END OPENVPN RULES/ d' /etc/ufw/before.rules
|
||||||
|
$SUDO ufw delete allow from 10.8.0.0/24 >/dev/null
|
||||||
|
$SUDO ufw delete allow ${PORT}/udp >/dev/null
|
||||||
$SUDO ufw reload
|
$SUDO ufw reload
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue