User Tools

Site Tools


eduardo:linux:ntpd

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
eduardo:linux:ntpd [2015/04/02 11:14] eduardoeduardo: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
 +
 <code> <code>
 [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
 +</code>
 +
 +===== firewallld =====
 +
 +Using firewallld. Assuming default zone is public.
 +
 +<code>
 +[bash]# sudo firewall-cmd --zone=public --add-service=ntp
 +
 +[bash]# sudo firewall-cmd --reload
 +</code>
 +
 +To verify the rules.
 +
 +<code>
 +[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: 
 </code> </code>
  
Line 39: Line 69:
 <code> <code>
 [bash]#  service ntpd restart [bash]#  service ntpd restart
 +</code>
 +
 +In RH 7.X. Restart NTPD
 +<code>
 +[bash]#  systemctl start ntpd.service
 </code> </code>
  
Line 61: Line 96:
 [bash]# chkconfig --level 2345 ntpd on [bash]# chkconfig --level 2345 ntpd on
 [bash]# /etc/init.d/ntpd restart [bash]# /etc/init.d/ntpd restart
 +
 +Or in RH7.x
 +[bash]# systemctl enable ntpd.service
 </code> </code>
  
Line 67: Line 105:
 <code> <code>
 [bash]# chkconfig --list ntpd  [bash]# chkconfig --list ntpd 
 +
 +Or in RH7.x
 +
 +[bash]# systemctl list-unit-files | grep ntpd
 </code> </code>
  
eduardo/linux/ntpd.1427973275.txt.gz · Last modified: 2024/02/23 08:19 (external edit)