How to Configure Time Server (NTP Server) on Centos 7?

Prerequisites:

VM/ Physical – It is recommended to have the time server as a physical server, but VMs should be okay depending on your setup and requirement. My virtual lab environment is VMware based so here’s the guide for a VM. Once the CentOS Minimal is installed on the VM make sure to install open-vm-tools.

If you are not conformable with Vi Editor please use install nano for editing.

Installing the time server:

  1. First we need to install NTPd . to do this open command line :

  2. Then open NTP main configuration file for editing:
    If you are planning on hosting your time servers externally like time01.yourdomain.com, time02.yourdomain.com with ports 123 open on the firewall. Each of the time server will be talking to 0.us.pool.ntp.org, 0.us.pool.ntp.org, 0.us.pool.ntp.org, 0.us.pool.ntp.org. Later on you can probably add your time servers to the NTP.org by joining the pool. For my example, I am not using the centos default pool, but i am using the U.S. zone. For internal servers/workstations you can point it to the local ip/dns name for the local time servers.

  3. Then start and enable ntp server:

  4. You need to allow ntp service on firewall(NTP service uses UDP port 123). So run next command:

  5. Verify you ntp service with next command:

Your output should be similar to: