Solved

NTP Server to update clients

Posted on 2010-09-08
16
921 Views
Last Modified: 2012-05-10
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
0
Comment
Question by:ipconfig610
  • 6
  • 4
  • 3
  • +1
16 Comments
 
LVL 2

Accepted Solution

by:
andrel39 earned 200 total points
ID: 33626591
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
 

Author Comment

by:ipconfig610
ID: 33626870
Should I tell all 14 of my Linux servers to get time from time.nist.gov or just the web servers?
0
 
LVL 7

Assisted Solution

by:vipul999
vipul999 earned 100 total points
ID: 33627203
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
 
LVL 2

Expert Comment

by:andrel39
ID: 33627474
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
 

Author Comment

by:ipconfig610
ID: 33627759
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
 
LVL 2

Expert Comment

by:andrel39
ID: 33627920
Are you using the ip address or ntp1.MYDOMAIN.com? You should be using the ip address.

0
 
LVL 2

Expert Comment

by:andrel39
ID: 33627923
Make sure you can ping it as well.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:ipconfig610
ID: 33627979
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
 
LVL 2

Expert Comment

by:andrel39
ID: 33628077
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
 

Author Comment

by:ipconfig610
ID: 33629320
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
 
LVL 12

Assisted Solution

by:mccracky
mccracky earned 200 total points
ID: 33631966
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
 
LVL 12

Expert Comment

by:mccracky
ID: 33632017
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
 
LVL 2

Expert Comment

by:andrel39
ID: 33636240
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
 
LVL 12

Expert Comment

by:mccracky
ID: 33794319
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

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now