Set up NTP Server on CentOS 6

Part 3 of setting up a Linux home lab environment with VirtualBox. Check this blog post for more info.

NTP is used to synchronise the time on our Linux system with a centralised NTP server. A local NTP server on the network can be synchronised with an external timing source to keep all the servers in our organisation in-sync with an accurate time.

Software

Software used in this article:

  1. CentOS 6
  2. NTP 4.2

Intall and Configure an NTP Server

Install NTP package:

# yum install -y ntp

Open /etc/ntp.conf file for editing and add the following:

tinker panic 0

restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict -6 ::1

server 0.uk.pool.ntp.org iburst
server 1.uk.pool.ntp.org iburst
server 2.uk.pool.ntp.org iburst
server 3.uk.pool.ntp.org iburst

driftfile /var/lib/ntp/drift

Server list may differ depending on your location.

Iptables will be configured via Puppet. The line below is used for the time being only:

# iptables -A INPUT -s 10.8.8.0/24 -p udp -m state --state NEW --dport 123 -j ACCEPT

Troubleshooting

Check logs:

# tail /var/log/messages

Leave a Reply

Your email address will not be published. Required fields are marked *