Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NTP Client

Status
Not open for further replies.

netwalker1

Programmer
Feb 5, 2000
1,241
EG
Dear All :
I have a linux Box ( Redhat Server 2.3 )and I want to synchronize its time with Windows 2000 NTP Server ,

How can I do this ..

I made some steps :
1- edit the file [/b]/etc/ntp.conf[/b]
[green]server myserver_IP_Address prefer # local clock
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 2
driftfile /etc/ntp/drift
multicastclient # listen on default 224.0.1.1
broadcastdelay 0.008
authenticate no [/green]

what shall I do then ?


Mohamed Farid
[green]Know Me No Pain , No Me Know Pain !!![/green]
CCNP,CCSP,CCA,MCSE,MCSA
 
I typically throw a task into the crontab every few hours to run

"ntpdate -s ntp.hostname" or
"ntpdate -s [ntp server IP]"

There's really no reason to run the ntpd daemon if all you want is to have your localhost time set. IMHO. Saves a few memory units too by not running the daemon full time.

Hosting Solutions for Home or Business.
 
when I use it , it doesn't change ..
it gave me no error ..
but it doesn't synchronize !



Mohamed Farid
[green]Know Me No Pain , No Me Know Pain !!![/green]
CCNP,CCSP,CCA,MCSE,MCSA
 
yes

Mohamed Farid
[green]Know Me No Pain , No Me Know Pain !!![/green]
CCNP,CCSP,CCA,MCSE,MCSA
 
run ntpdc and issue the command 'peers' and see if the output gives any indication of what's going on.
 
I used the command , and I used host sub-command to identify my Linux Box
then I used Peers sub-command and this is the output :
ntpdc: read: Connection refused




Mohamed Farid
[green]Know Me No Pain , No Me Know Pain !!![/green]
CCNP,CCSP,CCA,MCSE,MCSA
 
Yes !

Mohamed Farid
[green]Know Me No Pain , No Me Know Pain !!![/green]
CCNP,CCSP,CCA,MCSE,MCSA
 
Does your ntpd.conf prevent your server from trusting the time source? "restrict default ignore" is the default, and I've found that changing that or adding another line for the time source fixes the issue.
 
I removed this line before ,, shall I add it ?

Mohamed Farid
[green]Know Me No Pain , No Me Know Pain !!![/green]
CCNP,CCSP,CCA,MCSE,MCSA
 
The only time I get "ntpdc: read: Connection refused" is when ntpd is not running. Or maybe it's a firewall issue. If you can't run ntpdc, then that in itself show something systemically wrong.

Just for kicks do a "ps -ef | grep [n]tpd
 
I would. I don't know what the effect is of not having a "restrict" clause at all. If you just put in
"restrict <serverip> mask 255.255.255.255" I think that will get it started. You can lock it down a little further if you want after it's at least working.

I can't help with the Windows part, assuming that it's running as an NTP server. Try syncing with a public NTP source that you know to be working, then see if the Windows host works.
 
Good point, lgarner.

Try these servers:

server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org
 
Yes, but Dave, the question was "how do I get this to work?" not "do I need to get this to work?". You're falling prey to one of my pet peeves on forums like this where someone asks "how do I do A" and someone replies "you don't want to do A, you should do B".

There may be constraints that netwalker1 hasn't told us because they are not relavent to the question. I had a client that was a brokerage and *by law* had to sync their server time from a stratum 2 or higher server and doing an ntpdate would have been insufficient for their needs.

Sorry for the offtopic post.
 
Eric, I respect your opinion highly... I disagree with you, though, and am sorry that you have a peeve over it. My line of thinking was in response to the post's opening sentence:

Code:
I have a linux Box ( Redhat Server 2.3 )and I want to synchronize its time with Windows 2000 NTP Server

That, to me, implied a strategy that did not require the complexity the poster was engaging and I have tried to point out an alternative I thought simpler to use.

If there are requirements that mandate otherwise, the poster is responsible for choosing what solution(s) to implement or informing us as to those requirements to better refine our advice.

But, as is normal Eric, your valuable contributions should point to a successful resolution as well.



Hosting Solutions for Home or Business.
 
You know, you're right. I had forgotten the original post since we got off on figuring out why ntpd wouldn't synch. :)

Before I got a working ntpd config and found servers I could use regularly I would do intermittent ntpdates on my home boxes.

And, BTW, peeve isn't actual anger, it's more like when your socks won't stay up, nothing to get upset over but annoying, none the less. You *were* on-topic though and proposed a simpler strategy since ntpd is not actually working, so please disregard my previous diatribe. :)
 
I am sorry for interrupt u :) , but I am still facing problem !

I need to make the time on the Linux the same as the time in the Windows .. without touching the Windows NTP Server ..

How Can I do this ..
the command : ntpdate failed ! because it can't synchronize ..

what else should I Do .. ?

Mohamed Farid
[green]Know Me No Pain , No Me Know Pain !!![/green]
CCNP,CCSP,CCA,MCSE,MCSA
 
See, you've got something way wronger than just the date.

Try syncing with a non-windows server to make sure it is not a problem with the windows box, does the box have an internet connection?

If it syncs, then your windows box is at fault, if it doesn't then we need to start delving into possible firewall issues or looking at network traffic with tcpdump.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top