Link to home
Create AccountLog in
Avatar of ipconfig610
ipconfig610Flag for United States of America

asked on

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
ASKER CERTIFIED SOLUTION
Avatar of andrel39
andrel39
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of ipconfig610

ASKER

Should I tell all 14 of my Linux servers to get time from time.nist.gov or just the web servers?
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
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.

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

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

Make sure you can ping it as well.
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.
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.
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.
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
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.
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.
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.