Wednesday, May 2, 2012

How to Setup NTP server and Client (CentOS/RHEL)

NTP (Network time protocol) is used to  synchronize a computer's time in a local network (usually behind firewall )with another reference time source.

1. Install NTP package
2. configure ntp.conf
3. start ntpd daemon
4.check   with ntpq -n

check the correct

cat /etc/sysconfig/clock

rpm -qa ntp

one US and one Canada NTP Server

vim /etc/ntp.conf
# permit the source to query or modify the service on this system.
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery

# Permit all access over the loopback interface.  This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict -6 ::1

# Hosts on local network are less restricted.
restrict mask nomodify notrap
restrict mask nomodify notrap

# Use public servers from the project.
# Please consider joining the pool (

# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available.
#server     # local clock
fudge stratum 10

#service ntpd restart

 ntpdate -u

 ntpq -p

No comments:

Post a Comment