Wednesday, August 3, 2011

How to configure NTP Server in Linux

How to configure NTP Server In Linux
=====================================

Configured NTP Server in 192.168.100.223 ( support.symbioticinfo.com )

#Server Side
============
NTP Server Pool Address
1.server 1.asia.pool.ntp.org
2.server 0.asia.pool.ntp.org

#Permitting local network to use this
restrict 192.168.100.0 mask 255.255.255.0 nomodify notrap
restrict 192.168.10.0 mask 255.255.255.0 nomodify notrap
restrict 192.168.20.0 mask 255.255.255.0 nomodify notrap
restrict 192.168.30.0 mask 255.255.255.0 nomodify notrap
restrict 192.168.40.0 mask 255.255.255.0 nomodify notrap

#full access to the local net
restrict 127.0.0.1

#Client Side
===========

#yum install ntp

edit the ntp.conf file
#vim /etc/ntp.conf

#comment the following lines
#server 0.centos.pool.ntp.org
#server 1.centos.pool.ntp.org
#server 2.centos.pool.ntp.org

#add the following lines
restrict default ignore
server 192.168.100.223
restrict 192.168.100.1 mask 255.255.255.255 nomodify notrap noquery

#save and quit the file.

#Before starting the ntp daemon, run the following command

#ntpdate -b 192.168.100.223

#service ntpd start

#check the ntp

[root@gw ~]# ntpq -pn
remote refid st t when poll reach delay offset jitter
==============================================================================
192.168.100.223 140.109.1.4 11 u 3 64 1 0.257 0.368 0.001
127.127.1.0 .LOCL. 10 l 2 64 1 0.000 0.000 0.001
[root@gw ~]#

#you will get output like this..

++++++++++++++++++++++++++++++++++++THATS ALL++++++++++++++++++++++++++++++++++

No comments:

Post a Comment