One of my production servers, UFW configuration is as follows:
Status: active
Logging: on (low)
Default: deny (incoming), **deny (outgoing)**, disabled (routed)
New profiles: skip
To Action From
-- ------ ----
22/tcp ALLOW IN Anywhere
22/tcp (v6) ALLOW IN Anywhere (uv6)
80/tcp ALLOW IN Anywhere
80/tcp (v6) ALLOW IN Anywhere (v6)
I've enabled NTP synchronisation by installing ntp service and it's currently running. When I run ntpq -p, I get following output:
remote refid st t when poll reach delay offset jitter
==============================================================================
+209.114.111.1 132.163.4.103 2 u 52m 1024 374 44.591 3.390 0.983
+208.75.89.4 216.218.192.202 2 u 51m 1024 374 67.622 2.429 2.171
*204.9.54.119 .CDMA. 1 u 40m 1024 374 24.324 2.344 2.116
-72.14.183.239 200.98.196.212 2 u 41m 1024 374 41.822 4.611 2.649
-91.189.94.4 193.79.237.14 2 u 43m 1024 374 74.764 -0.407 3.417
From the above output, apparently it looks like ntp is already working properly without opening any additional port on ufw-firewall. Is this understanding correct OR do I need to open any port for NTP synchronization to work?
Thanks
But, feel free to verify this before taking firewall advice from an internet stranger: Make sure you're logging blocked connections, or at least blocked connections on 53 tcp & udp. Run a few dns queries (ping works fine for this), and check the log.
Just set up your DNS rule similar to the NTP rule: 53 UDP inbound & outbound. Leave your 53 TCP in place also.
– Neil Dec 19 '15 at 07:03