Configure basic ntp server and client
From Notes_Wiki
<yambe:breadcrumb>Ntp_server_configuration|Ntp server configuration</yambe:breadcrumb>
Configure basic ntp server and client
Configure ntp server
To configure basic ntp server on centos use following steps:
- yum -y install ntp ntpdate ntp-doc
- edit /etc/sysconfig/ntpd and change to
- OPTIONS="-p /var/run/ntpd.pid -g"
- edit /etc/ntp.conf and add one line for each local network as follows:
- restrict 192.168.2.0 mask 255.255.255.0 nomodify notrap
- service ntpd restart
- ntpq
- pe
- as
- If peers show strata (st) greater than 3 or 4 and associations show reach as no then there must be a firewall issue
Note that setting up ntp server or client on openVZ container will not work. Both ntp server and client must be setup only on base machines
Configure ntp client
- yum -y install ntp ntpdate ntp-doc
- edit /etc/sysconfig/ntpd and change to
- OPTIONS="-p /var/run/ntpd.pid -g"
- edit /etc/ntp.conf and comment all server lines. Finally add one server line to point to local ntp server
- service ntpd restart
- ntpq
- pe
- as
- If peers show strata (st) greater than 3 or 4 and associations show reach as no then there must be a firewall issue
To debug connection to local ntp server you can use: "ntpdate -db <ntp-server>" and see what is going on.
<yambe:breadcrumb>Ntp_server_configuration|Ntp server configuration</yambe:breadcrumb>