Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

http://www.pool.ntp.org/en/

XYMon-NTP

This is setup for North America, if you are in another Time Zone, please get your specific Time Zone Pool from this link.

Don't forget to Open Port 123!

No Format
sudo su

Ubuntu

No Format
apt-get update
apt-get install ntp

CentOS

No Format
yum install -y ntp

SERVER

Configure

No Format
mv /etc/ntp.conf /etc/ntp.conf.bak
cat << EOL >/etc/ntp.conf
server 0.north-america.pool.ntp.org iburst
server 1.north-america.pool.ntp.org iburst
server 2.north-america.pool.ntp.org iburst
server 3.north-america.pool.ntp.org iburst
server  127.127.1.0
fudge   127.127.1.0 stratum 10
restrict 127.0.0.1
restrict ::1
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict -4 default kod nomodify notrap nopeer noquery
driftfile /var/lib/ntp/ntp.drift
logfile /var/log/ntp.log
EOL
service ntp restart
watch ntpq -p

CLIENT

Configure

Replace 

No Format
[server 192.168.1.255/ntp.domain.com prefer iburst]
No Format
mv /etc/ntp.conf /etc/ntp.conf.bak
cat << EOL >/etc/ntp.conf
[server 192.168.1.255/ntp.domain.com prefer iburst]
server 0.north-america.pool.ntp.org iburst
server 1.north-america.pool.ntp.org iburst
server 2.north-america.pool.ntp.org iburst
server 3.north-america.pool.ntp.org iburst
server  127.127.1.0
fudge   127.127.1.0 stratum 10
restrict 127.0.0.1
restrict ::1
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict -4 default kod nomodify notrap nopeer noquery
driftfile /var/lib/ntp/ntp.drift
logfile /var/log/ntp.log
EOL
service ntp restart
watch ntpq -p

CentOS 7

No Format
systemctl enable ntpd.service
service ntpd start
yum remove -y chrony
timedatectl set-ntp true
firewall-cmd --add-service=ntp --permanent 
firewall-cmd --reload