mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
basic firewalld/iptables configuration
This commit is contained in:
parent
66724826f5
commit
e6634531c7
1 changed files with 17 additions and 0 deletions
|
@ -741,6 +741,22 @@ setUser(){
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
configureFirewall() {
|
||||||
|
# Allow HTTP and DNS traffic
|
||||||
|
if [ -x "$(command -v firewall-cmd)" ]; then
|
||||||
|
$SUDO echo "::: Configuring firewalld for httpd and dnsmasq.."
|
||||||
|
$SUDO firewall-cmd --zone=public --permanent --add-service=http
|
||||||
|
$SUDO firewall-cmd --zone=public --permanent --add-service=dns
|
||||||
|
$SUDO firewall-cmd --reload
|
||||||
|
elif [ -x "$(command -v iptables)" ]; then
|
||||||
|
$SUDO echo "::: Configuring iptables for httpd and dnsmasq.."
|
||||||
|
$SUDO iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
|
||||||
|
$SUDO iptables -A INPUT -p tcp -m tcp --dport 53 -j ACCEPT
|
||||||
|
else
|
||||||
|
$SUDO echo "::: No firewall detected.. skipping firewall configuration."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
installPihole() {
|
installPihole() {
|
||||||
# Install base files and web interface
|
# Install base files and web interface
|
||||||
checkForDependencies # done
|
checkForDependencies # done
|
||||||
|
@ -766,6 +782,7 @@ installPihole() {
|
||||||
installPiholeWeb
|
installPiholeWeb
|
||||||
installCron
|
installCron
|
||||||
runGravity
|
runGravity
|
||||||
|
configureFirewall
|
||||||
}
|
}
|
||||||
|
|
||||||
displayFinalMessage() {
|
displayFinalMessage() {
|
||||||
|
|
Loading…
Reference in a new issue