Thursday, March 7, 2013

NTP server set up

Network Time Protocol (NTP)

NTP is used to synchronize the time of a remote computer system over the network. It oprates on port 123.

1. Configure NTP server
a. Edit /etc/ntp.conf file and specify the ntp server which you want to sync your system with remote system.
Note: Normally we sync the time with local time clock or University time clock.
# vi /etc/ntp.conf
uncomment the server section, in my case, I am using the time server from Reston, va

# Time server from, Reston VA
# Reston, Virginia

b. save the file and restart the ntpd service
# service ntpd status
ntpd is stopped

# service ntpd start
Starting ntpd:                                             [  OK  ]

c. Make sure to start the ntpd service on every reboot.
# chkconfig --list ntpd
ntpd            0:off   1:off   2:off   3:off   4:off   5:off   6:off
# chkconfig ntpd on
# chkconfig --list ntpd
ntpd            0:off   1:off   2:on    3:on    4:on    5:on    6:off

# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
============================================================================== .ACTS.           1 u    5   64    1   19.956  -863494   0.000

st value is 1 so its a good one...

# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
=================================================== .INIT.          16 u    -   64    0    0.000    0.000   0.000


Note: If you see ST value more than 5, your NTP is not syncing with the server. Please check and verify that server is operational.
Note: The Output jitter value of 000 or less than 1 is consider successfull

To check the NTP status,
# ntpstat -p

  time server re-starting
   polling server every 64 s


Setting up NTP Client
To setup NTP client, you just use the /etc/ntp.conf file and specify the NTP server name that you just created.

# vi /etc/ntp.confComment that all begins with server and add your NTP server info.


# service ntpd start
# chkconf ntpd on

To update or sync your client system with NTP server,
# ntpdate -u

No comments:

Post a Comment