NTP Server to update clients

We are running 14 Linux Centos 5.4 servers, 2 Cisco 3900 routers and 2 Cisco 48 port switches.  We need all hardware to have the same time for troubleshooting.  2 of my 14 servers are web servers which i would like to make ntp1 and ntp2 hosting time to the rest of the network.  We also have about 150 routers deployed to clients which should also get its time from our time servers remotely (ntp1.mydomain.com & ntp2.mydomain.com).  

How do I setup ntp1 and ntp2 to sync with time.nist.gov and all my other servers and routers to sync with ntp1.MyDomain.com and ntp2.MyDomain.com?

Thanks
ipconfig610Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
andrel39Connect With a Mentor Commented:
Just install the ntp service on the two web servers. Set those two servers to sync to time.nist.gov.
(see below for procedure)

You will need to setup your external DNS to your Web Servers for the ntp1 and ntp2. Also, your firewalls for NAT to your web servers, or how ever you want, and allow the ntp service.

Now for the hard part. You will probably have to touch every device to set the ntp client to sync to your servers, unless someone else knows of a way to auto update 150 routers with a push of button.

Install ntp on Centos
Login as the root user

Type the following command to install ntp
# yum install ntp

Turn on service
# chkconfig ntpd on

Synchronize the system clock with time.nist.gov server:
# ntpdate time.nist.gov

Start the NTP:
# /etc/init.d/ntpd start
0
 
ipconfig610Author Commented:
Should I tell all 14 of my Linux servers to get time from time.nist.gov or just the web servers?
0
 
vipul999Connect With a Mentor Commented:
yeah you should do it directly.. that way even is ntp1 or ntp2 are down.. time will still continue to update as long as the internet is connected.
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
andrel39Commented:
You should tell all your hardware to use your ntp/web servers to get their time, in other words uniformity. This will help when you wondering how you configured them in the past.

0
 
ipconfig610Author Commented:
Okay, I setup my 2 web servers to get time from time.nist.gov in /etc/ntp.conf and than ran a service ntpd restart. I also pointed UDP port 123 on my Cisco router to my web server.

When I point one of my routers to ntp1.mydomain.com I receive "no server suitable for synchronization found"

What step am i missing?

/etc/ntp.conf file:


restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery

restrict 127.0.0.1
restrict -6 ::1

server ntp1.MYDOMAIN.com
server ntp2.MYDOMAIN.com

server  127.127.1.0     # local clock
fudge   127.127.1.0 stratum 10

driftfile /var/lib/ntp/drift

keys /etc/ntp/keys

Open in new window

0
 
andrel39Commented:
Are you using the ip address or ntp1.MYDOMAIN.com? You should be using the ip address.

0
 
andrel39Commented:
Make sure you can ping it as well.
0
 
ipconfig610Author Commented:
Yes I have an A Record pointing ntp1.MYDOMAIN.com to my servers WAN IP which I have confirmed is working and pings to the correct IP address.

I assume UDP 123 is the default NTP port.
0
 
andrel39Commented:
Yes UDP 123 is the ntp port.

Has it been long enough for the DNS change to take effect? DNS updates usually take 24-48 hours before fully functional.
0
 
ipconfig610Author Commented:
I setup the A Records on my DNS server a few weeks ago.  When I ping the FQDN it resolves the correct IP of each NTP server.
0
 
mccrackyConnect With a Mentor Commented:
The no server suitable message means that the web servers haven't settled in to their time yet.  wait about an hour and try again (or put in the iburst option on the web servers' ntp.conf configuration)
0
 
mccrackyCommented:
to check if the web servers have settled in, you can do a "ntpq -pn" and see if you see an asterisk ("*") in the first column.  That means that it has settled in to receive time from that server.

Also, for what it's worth, put in a couple of other servers in your web server like:

server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org

It's common practice to have three or four external servers for your main server(s).

I'd also put the two web servers as peers of each other:

on web server 1:

peer ntp2.mydomain.com

on web server 2:

peer ntp1.mydomain.com


This peering will help them keep time with each other if, for some reason, they lose access to the servers listed.
0
 
andrel39Commented:
Yes, Mccracky is correct, the other reason for the error message is that they havn't had enough time to settle in to the sync. It could take a few hours.
0
 
mccrackyCommented:
I'm just wondering why the points were awarded to the answer that said mine was correct.  I had a full explanation in the comment right above the "solution" and my comment right above that one (two above the "solution") also explained that the servers probably hadn't had time to settle in to sync yet which was the other part of the "solution"

Just curious.
0
All Courses

From novice to tech pro — start learning today.