Versions Compared

Key

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

...

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
timedatectl set-ntp true
firewall-cmd --add-service=ntp --permanent 
firewall-cmd --reload