Configure NTP server on Redhat

This entry was posted in Unix and tagged on June 17, 2012, by

WHAT IS NTP?

NTP (Network Time protocol) is an internet protocol used to synchronize the clocks of computers to some time interface.

Steps to configure Server and Client

1. First check for the install package for ntp

# rpm -qa ntp

If it it not there just install the package.

# rpm -ivh ntp

2. Start the service

# chkconfig ntpd on

3. Edit the /etc/ntp.conf file

Our sample setup

remote ISP server: 202.54.1.15

Redhat NTP servrer: 192.168.9.10

Client NTP: 192.168.9.0/24

Edit two lines.

# vi /etc/ntp.conf

restrict 202.54.1.15 mask 255.255.255.245 nomodify notrap noquery
server  202.54.1.15

Save and quit.

Replace the IP with your actual IP of the server.

4. Next step is to configure Client.

Now we need to allow 192.168.9.0 network to synchronize to this server located at 192.168.9.10

Add the following in the file

   # vi /etc/ntp.conf

# Hosts on local network are less restricted.
   restrict 192.168.9.0 mask 255.255.255.0 nomodify notrap

Save and quit

5. Update the iptables firewall

Edit the file and Add the following line, before the final LOG and DROP lines for the RH-Firewall-1-INPUT chain

# vi /etc/sysconfig/iptables

-A RH-Firewall-1-INPUT -s 192.168.9.0/24 -m state --state NEW -p udp --dport 123 -j ACCEPT

Save and quit.

6. Start the Services

# service iptables restart

# service ntpd start

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright 2017 ©Aceadmins. All rights reserved.