Wednesday, May 21, 2014

NTP Server / Client

NTP SERVER

# yum install ntp -y
# /etc/init.d/ntpd start
# chkconfig ntpd on
-Open the UDP 123 port in your firewal
# iptables -I INPUT -m state --state NEW -m udp -p udp --dport 123 -j ACCEPT
# service iptables save

Open the configuration file and uncomment where ip restrict is and modify the subnet according to your subnet.
# vim /etc/ntp.conf

{# Hosts on local network are less restricted.}
{#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap}
s/
# Hosts on local network are less restricted.
restrict 192.168.122.0 mask 255.255.255.0 nomodify notrap
:wq

# /etc/init.d/ntpd restart

To verify your server synced with the most accurate time server available after couple minutes. 
# ntpq -p

Output should show in *servername for the synced server

NTP CLIENT

# yum install ntp -y
# /etc/init.d/ntpd start
# chkconfig ntpd on

Comment out all 4 default servers from the OS System and enter your time server in the /etc/ntp.conf file.

# vim /etc/ntp.conf
server 192.168.122.50 iburst
:wq

Check if your NTP client is synced with the NTP server you have provided
# ntpq -p

No comments:

Post a Comment