The following post explains how to setup a NTP server and client on redhat linux systems like rhel5. It will also work on centos, fedora, Suse linux etc.
[root@server ~]# rpm -qa | grep ntp
ntp-4.2.2p1-9.el5_3.2
NTP Server IP : 192.168.1.19
Client IP : 192.168.1.60
Client Configuration :
/etc/ntp.conf - primary conf file.
open the /etc/ntp.conf file and give the IP of the NTP server as follows
[root@work1 ~]# vi /etc/ntp.conf
server 192.168.1.19
#Give IP address or FQDN of the NTP server
#Remove all the server entries from the /etc/ntp.conf file.:wq
#Save the file
Restart the service:
[root@work1 ~]# service ntpd start
[root@work1 ~]# ntpq -np
remote refid st t when poll reach delay offset jitter
==============================================================================
*192.168.1.19 LOCAL(0) 11 u 78 128 377 0.682 -0.142 0.071 # * Means default
127.127.1.0 .LOCL. 10 l 44 64 377 0.000 0.000 0.001
[root@work1 ~]#
It may take sometime. Or may require a reboot.
To make an immediate effect. Use ntpdate command
[root@work1 ~]# ntpdate -b NTP_Server_IP_or_FQDN
[root@work1 ~]# ntpdate -b 192.168.1.19
29 Mar 15:40:17 ntpdate[6138]: the NTP socket is in use, exiting
[root@work1 ~]#
No comments:
Post a Comment