NTP Server & Client Configuration

Hi, Lets configure an Internal NTP Server in an easiest ways we have. This particular configuration is done and implemented for GEM Granites, Chennai, One of our client.

Server Configuration:-

1) Make Sure to install NTP rpm in your Server.

[root@tripwire ~]# rpm -qa |grep ntp
ntp-4.2.2p1-9.el5

2) Change the configuration file /etc/ntp.conf of NTP Server

Comment the following lines
#restrict default kod nomodify notrap nopeer noquery
#restrict -6 default kod nomodify notrap nopeer noquery

Add the following line with the IP range and Subnet of your network.

restrict 192.168.8.0 mask 255.255.255.0 nomodify notrap
restrict 192.168.110.0 mask 255.255.255.0 nomodify notrap

You can add number of lines based on your networks.

Add some broadcast delay

broadcastdelay 0.008

It Sets the estimated round-trip delay between the broadcast NTP server and the router.

Once all the required parameters are changed the configuration file will look like the following.

Quote:
[root@tripwire ~]# cat /etc/ntp.conf|grep -v "#"|grep -v '^$'
restrict 127.0.0.1
restrict -6 ::1
restrict 192.168.8.0 mask 255.255.255.0 nomodify notrap
server 0.rhel.pool.ntp.org
server 1.rhel.pool.ntp.org
server 2.rhel.pool.ntp.org
fudge 127.127.1.0 stratum 10
driftfile /var/lib/ntp/drift
keys /etc/ntp/keys
broadcastdelay 0.008


3) We will sync the time of this server with the public redhat server or else you can set the time manually and that depends on our requirement.

[root@tripwire ~]# cat /etc/ntp/step-tickers
clock.redhat.com
clock2.redhat.com

4) Now restart the NTP service.

[root@tripwire ~]# /etc/init.d/ntpd restart
Shutting down ntpd: [ OK ]
ntpd: Synchronizing with time server: [ OK ]
Starting ntpd: [ OK ]

Client Configuration:

1) Comment the following lines shown over here.

#restrict default kod nomodify notrap nopeer noquery
#restrict -6 default kod nomodify notrap nopeer noquery

Add the follwoing lines to the config file.

restrict default ignore
restrict 192.168.8.131 mask 255.255.255.0 nomodify notrap noquery
server 192.168.8.131
broadcastdelay 0.008

2) Now use the following command to update the time

#ntpdate -ud 192.168.8.131

Here is the output when the above command is given

Code:
[root@qmaildap ~]# ntpdate -ud 192.168.8.131
24 Dec 10:35:23 ntpdate[5272]: ntpdate 4.2.2p1@1.1570-o Wed Sep 3 14:28:16 UTC 2008 (1)
Looking for host 192.168.8.131 and service ntp
host found : 192.168.8.131
transmit(192.168.8.131)
receive(192.168.8.131)
transmit(192.168.8.131)
receive(192.168.8.131)
transmit(192.168.8.131)
receive(192.168.8.131)
transmit(192.168.8.131)
receive(192.168.8.131)
transmit(192.168.8.131)
server 192.168.8.131, port 123
stratum 11, precision -20, leap 00, trust 000
refid [192.168.8.131], delay 0.02571, dispersion 0.00000
transmitted 4, in filter 4
reference time: d0bea884.c0f83a47 Fri, Dec 24 2010 10:35:08.753
originate timestamp: d0bea893.57906454 Fri, Dec 24 2010 10:35:23.342
transmit timestamp: d0bea893.66f49cf5 Fri, Dec 24 2010 10:35:23.402
filter delay: 0.02588 0.02576 0.02571 0.02571
0.00000 0.00000 0.00000 0.00000
filter offset: -0.06016 -0.06019 -0.06018 -0.06017
0.000000 0.000000 0.000000 0.000000
delay 0.02571, dispersion 0.00000
offset -0.060182

24 Dec 10:35:23 ntpdate[5272]: adjust time server 192.168.8.131 offset -0.060182 sec


Here ends the configuration. Enjoy!!!...

Comments

Popular posts from this blog

28 Names of Srimati Radha Rani (Hindi/Odia/English)