Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

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!

sudo su

Ubuntu

apt-get update
apt-get install ntp

CentOS

yum install -y ntp

SERVER

Configure

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 

[server 192.168.1.255/ntp.domain.com prefer iburst]
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

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

 

 

  • No labels