Monday, June 1, 2009

Setting up NTP Server for Local Network

First for definition. From Wikipedia

The Network Time Protocol (NTP) is a protocol for synchronizing the clocks of computer systems over packet-switched, variable-latency data networks. NTP uses UDP on port 123 as its transport layer.


Setting Up NTP Server

Step 1: Install NTP Server and Client
# yum install ntp


Step 2: Configuration at /etc/ntp.conf
(The Basic Configuration is sufficient. A few things to note)
# vim /etc/ntp.conf

(Inside the /etc/ntp.conf) This statement is to allow local network to access the Server...
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

(Inside the /etc/ntp.conf) Ensure the localhost has full access without any restructing password
restrict 127.0.0.1


Step 3: Start the Services

# chkconfig --levels 235 ntpd on
# ntpdate 0.pool.ntp.org
# service ntpd start

Check whether it is working
# ntpq -p





Setting Up NTP Clients to sync with the local NTP Server and NTP Client


Step 1: Install the ntpd services
# yum install ntp


Step 2: Configure the /etc/ntp.conf
# vim /etc/ntp.conf

(Inside the /etc/ntp.conf) Point to the local NTP Server
server 192.168.1.1


Step 3: Start the Services
# chkconfig --levels 235 ntpd on
# ntpdate 192.168.1.1
# service ntpd start


Check whether it is working
# ntpq -p
For more readings:
  1. How to Setup a Time Server in Linux from TechGuruLive (Debian-Based Server)

1 comment: