NTP Server setup + client setup

NTP Server

Steps to install NTP server.
# yum install ntp
Then sync server with 0.rhel.pool.ntp.org, to obtain accurate time data.
After that Open /etc/ntp.conf
Make sure the following line exits:
restrict default ignore
This will deny all access to any machine, server or client.

If this server is also going to provide time for other computers, such as PCs, other Linux servers and networking devices, then you’ll have to define the networks from which this server will accept NTP synchronization requests. You do so with a modified restrict statement removing the noquery keyword to allow the network to query your NTP server. The syntax is:

restrict mask nomodify notrap

At last you need to server value like this
(my local time server all device sync with this
devices or you can use public server for date time.)

NTP Started

# chkconfig ntpd on
# service ntpd start
NTP – Client Setup
For client setup make sure rpm installed.
# yum install ntp
Open ntp.conf file and disable all public server just add a new line like below
Save the file and exit. The run ntpdate command to sync with your ntp server.
[root@raj ~]# ntpdate

29 Mar 21:39:03 ntpdate[15974]: adjust time server offset 0.000039 sec

Now make sure services on at boot time.
[root@raj ~]# chkconfig ntpd on
[root@raj ~]# /etc/init.d/ntpd start

Starting ntpd: [ OK ]

Verifying NTP is Running

[root@tc1oltp1 ~]# pgrep ntpd

Use the ntpq command to see the servers with which you are synchronized. It provided you with a list of configured time servers and the delay, offset and jitter

[root@tc1oltp1 ~]# ntpq -p
remote refid st t when poll reach delay offset jitter
*tc1tools1.myserver LOCAL(0) 11 u 41 64 17 0.514 -0.473 0.461
LOCAL(0) .LOCL. 10 l 38 64 17 0.000 0.000 0.001

Firewall port open at server end add following lines

-A RH-Firewall-1-INPUT -m state –state NEW -p udp –dport 123 -j ACCEPT

save and restart iptables.

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: