eduardo:linux:ntpd
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
eduardo:linux:ntpd [2015/04/02 11:14] – eduardo | eduardo:linux:ntpd [2024/02/23 08:20] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== NTPD ====== | ====== NTPD ====== | ||
NTP servers communicate over port 123 UDP and unlike most UDP protocols the source port is NOT a high port, but uses 123 as well. The firewall must be configured to allow UDP on both source and destination ports 123 between your new NTP server and the Stratum 1 server. | NTP servers communicate over port 123 UDP and unlike most UDP protocols the source port is NOT a high port, but uses 123 as well. The firewall must be configured to allow UDP on both source and destination ports 123 between your new NTP server and the Stratum 1 server. | ||
+ | |||
+ | ===== iptables ===== | ||
+ | |||
+ | Using iptables | ||
+ | |||
< | < | ||
[bash]# iptables -I INPUT -p udp --dport 123 -j ACCEPT | [bash]# iptables -I INPUT -p udp --dport 123 -j ACCEPT | ||
[bash]# service iptables save | [bash]# service iptables save | ||
+ | </ | ||
+ | |||
+ | ===== firewallld ===== | ||
+ | |||
+ | Using firewallld. Assuming default zone is public. | ||
+ | |||
+ | < | ||
+ | [bash]# sudo firewall-cmd --zone=public --add-service=ntp | ||
+ | |||
+ | [bash]# sudo firewall-cmd --reload | ||
+ | </ | ||
+ | |||
+ | To verify the rules. | ||
+ | |||
+ | < | ||
+ | [bash]# firewall-cmd --list-all | ||
+ | public (default, active) | ||
+ | interfaces: eth0 | ||
+ | sources: | ||
+ | services: dhcpv6-client ntp ssh | ||
+ | ports: | ||
+ | masquerade: no | ||
+ | forward-ports: | ||
+ | icmp-blocks: | ||
+ | rich rules: | ||
</ | </ | ||
Line 39: | Line 69: | ||
< | < | ||
[bash]# | [bash]# | ||
+ | </ | ||
+ | |||
+ | In RH 7.X. Restart NTPD | ||
+ | < | ||
+ | [bash]# | ||
</ | </ | ||
Line 61: | Line 96: | ||
[bash]# chkconfig --level 2345 ntpd on | [bash]# chkconfig --level 2345 ntpd on | ||
[bash]# / | [bash]# / | ||
+ | |||
+ | Or in RH7.x | ||
+ | [bash]# systemctl enable ntpd.service | ||
</ | </ | ||
Line 67: | Line 105: | ||
< | < | ||
[bash]# chkconfig --list ntpd | [bash]# chkconfig --list ntpd | ||
+ | |||
+ | Or in RH7.x | ||
+ | |||
+ | [bash]# systemctl list-unit-files | grep ntpd | ||
</ | </ | ||
eduardo/linux/ntpd.1427973275.txt.gz · Last modified: 2024/02/23 08:19 (external edit)