diff --git a/auto_install/install.sh b/auto_install/install.sh index 2875b31..732c78b 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -1473,6 +1473,12 @@ askClientDNS(){ echo "pivpnDNS1=${pivpnDNS1}" >> ${tempsetupVarsFile} echo "pivpnDNS2=${pivpnDNS2}" >> ${tempsetupVarsFile} + + # Allow DNS incomming requests through UFW. + if [ "$USING_UFW" -eq 1 ]; then + $SUDO ufw insert 1 allow in on "${pivpnDEV}" to any port 53 from "${pivpnNET}/${subnetClass}" >/dev/null + fi + return fi fi diff --git a/scripts/uninstall.sh b/scripts/uninstall.sh index 3a6a2a6..c003f68 100755 --- a/scripts/uninstall.sh +++ b/scripts/uninstall.sh @@ -101,6 +101,7 @@ removeAll(){ ufw delete allow "${pivpnPORT}"/"${pivpnPROTO}" > /dev/null ### FIXME: SC2154 ufw route delete allow in on "${pivpnDEV}" from "${pivpnNET}/${subnetClass}" out on "${IPv4dev}" to any > /dev/null + ufw delete allow in on "${pivpnDEV}" to any port 53 from "${pivpnNET}/${subnetClass}" >/dev/null sed "/-I POSTROUTING -s ${pivpnNET}\\/${subnetClass} -o ${IPv4dev} -j MASQUERADE -m comment --comment ${VPN}-nat-rule/d" -i /etc/ufw/before.rules iptables -t nat -D POSTROUTING -s "${pivpnNET}/${subnetClass}" -o "${IPv4dev}" -j MASQUERADE -m comment --comment "${VPN}-nat-rule" ufw reload &> /dev/null