Skip to content

Commit 86344ed

Browse files
Add NTP and HTTPS ports to firewalls
Add NTP as a used port, adds NTP and HTTPS to firewalls and adds an abbreviation for NTP. Signed-off-by: darkexplosiveqwx <[email protected]>
1 parent 444c2c1 commit 86344ed

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

docs/abbreviations.md

+1
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,4 @@
4848
*[URL]: Uniform Resource Locator, commonly known as "web address"
4949
*[REST]: Representational State Transfer - a software architecture for distributed systems like the World Wide Web (WWW)
5050
*[XSS]: Cross-site scripting
51+
*[NTP]: Network Time Protocol is used to synchronize the clocks of computers over a network

docs/main/prerequisites.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,11 @@ Pi-hole needs a static IP address to properly function (a DHCP reservation is ju
7878
| pihole-FTL | 547 (DHCPv6) | IPv6 UDP | The DHCP server is an optional feature that requires additional ports. |
7979
| pihole-FTL | 80 (HTTP)<br/>443 (HTTPS) | TCP | If you have another webserver already listening on port `80`/`443`, then `pihole-FTL` will attempt to bind to `8080`/`8443` instead. If neither of these ports are available, `pihole-FTL`'s webserver will be unavailable until ports are configured manually (see configuration option `webserver.port`) |
8080
| pihole-FTL | 4711 | TCP | FTL is our API engine and uses port 4711 on the localhost interface. This port should not be accessible from any other interface.|
81+
| pihole-FTL | 123 (NTP) | UDP | The NTP server is an optional feature that requires an additional port. |
8182

8283
!!! info
8384
The use of pihole-FTL on ports _67_ or _547_ is optional, but required if you use the DHCP functions of Pi-hole.
85+
The use of port _123_ is required when using pihole-FTL as NTP-Server.
8486

8587
### Firewalls
8688

@@ -97,12 +99,14 @@ IPTables (IPv4)
9799

98100
```bash
99101
iptables -I INPUT 1 -s 192.168.0.0/16 -p tcp -m tcp --dport 80 -j ACCEPT
102+
iptables -I INPUT 1 -s 192.168.0.0/16 -p tcp -m tcp --dport 443 -j ACCEPT
100103
iptables -I INPUT 1 -s 127.0.0.0/8 -p tcp -m tcp --dport 53 -j ACCEPT
101104
iptables -I INPUT 1 -s 127.0.0.0/8 -p udp -m udp --dport 53 -j ACCEPT
102105
iptables -I INPUT 1 -s 192.168.0.0/16 -p tcp -m tcp --dport 53 -j ACCEPT
103106
iptables -I INPUT 1 -s 192.168.0.0/16 -p udp -m udp --dport 53 -j ACCEPT
104107
iptables -I INPUT 1 -p udp --dport 67:68 --sport 67:68 -j ACCEPT
105108
iptables -I INPUT 1 -p tcp -m tcp --dport 4711 -i lo -j ACCEPT
109+
iptables -I INPUT 1 -p udp --dport 123 -j ACCEPT
106110
iptables -I INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
107111
```
108112

@@ -118,7 +122,7 @@ ip6tables -I INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
118122
Using the `--permanent` argument will ensure the firewall rules persist reboots. If only IPv4 blocking is used for the Pi-hole installation, the `dhcpv6` service can be removed from the commands below. Create a new zone for the local interface (`lo`) for the pihole-FTL ports to ensure the API is only accessible locally. Finally `--reload` to have the new firewall configuration take effect immediately.
119123

120124
```bash
121-
firewall-cmd --permanent --add-service=http --add-service=dns --add-service=dhcp --add-service=dhcpv6
125+
firewall-cmd --permanent --add-service=http --add-service=https --add-service=dns --add-service=dhcp --add-service=dhcpv6 --add-service=ntp
122126
firewall-cmd --permanent --new-zone=ftl
123127
firewall-cmd --permanent --zone=ftl --add-interface=lo
124128
firewall-cmd --permanent --zone=ftl --add-port=4711/tcp
@@ -133,10 +137,12 @@ IPv4:
133137

134138
```bash
135139
ufw allow 80/tcp
140+
ufw allow 443/tcp
136141
ufw allow 53/tcp
137142
ufw allow 53/udp
138143
ufw allow 67/tcp
139144
ufw allow 67/udp
145+
ufw allow 123/udp
140146
```
141147

142148
IPv6 (include above IPv4 rules):

0 commit comments

Comments
 (0)