mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-18 10:50:16 +00:00
Merge pull request #1410 from EWouters/master
Allow DNS incoming requests through UFW
This commit is contained in:
commit
88a3df99ca
2 changed files with 7 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -103,6 +103,7 @@ removeAll(){
|
|||
### Ignoring SC2154, value sourced from setupVars file
|
||||
# shellcheck disable=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
|
||||
|
|
Loading…
Reference in a new issue