LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-09-2006, 09:16 AM   #1
shamilson
LQ Newbie
 
Registered: Aug 2006
Posts: 11

Rep: Reputation: 0
ntpd time synchonization fails ...


Dear All,

I used the following coomand to synchronize the ntpd server with my two hosts. My hosts configurations are Red Hat 9.0, P4, 3.2 Ghz, Ram 512 MB.

server /etc/ntp.conf is

server 127.0.0.1
driftfile /etc/ntp/drift

and the client hosts /etc/ntp.conf are

server 192.168.0.4 # ip address of ntpd server
driftfile /etc/ntp/drift

But when i run the command
[root@cahost root]# service ntpd start
ntpd: Synchronizing with time server: [FAILED]
Starting ntpd: [ OK ]
[root@msc95 root]#

shows the time doen not seems to be syncronized properly. What is the problem i couldnot solve.


Further when i used the GUI mode, synchronization happens properlly at the first time.
But then again when i change the server time and cheks the GUI on clint matchine to syncrhonize the time it wont happen properlly.

help me to solve this
 
Old 08-09-2006, 02:52 PM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Hello.

I think you are going to have to try syncing manually (rather than using 'service') so that you can at least see the error message.
 
Old 08-09-2006, 09:50 PM   #3
shamilson
LQ Newbie
 
Registered: Aug 2006
Posts: 11

Original Poster
Rep: Reputation: 0
Could you help me how i can start up it manually.
thank you.
Quote:
Originally Posted by bulliver
Hello.

I think you are going to have to try syncing manually (rather than using 'service') so that you can at least see the error message.
 
Old 08-10-2006, 12:31 AM   #4
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Ok, wait. I re-read your post again...

You are starting the time server on the client machine, is that really what you want?
If you just want to sync your client to the server then you just have to do:

Code:
# ntpdate -b <timeserver-ip>
This is usually set up as a cron task, which you can run as often as you feel the need for (every hour is common...). Some distros (such as gentoo which I am using here) have an init script which basically sets this up for you. see if you have a service like 'ntp-client' or somesuch.

If I am again misunderstanding you and you really want to start the a time server then just do it like so:
Code:
# ntpd -u ntp:ntp
I was suggesting this because generally service scripts will send errors and output to /dev/null, making it difficult to debug.
 
Old 08-10-2006, 10:50 PM   #5
shamilson
LQ Newbie
 
Registered: Aug 2006
Posts: 11

Original Poster
Rep: Reputation: 0
Hi,
It also didnot work for me out. So let me explain a bit about my netwrok topology may be that time it would be clear.
In my topology i have 1 server and 2 client computers preinstalled with Red hat 9.0. I want my client timers be sychnonized with server.
So for that reason i run this commands on server computer (i.e my serve is cahost).

[root@cahost root]# chkconfig ntpd on
[root@cahost root]# service ntpd start
ntpd: Synchronizing with time server: [FAILED]
Starting ntpd: [ OK ]
[root@cahost root]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
cahost 0.0.0.0 16 l - 1024 0 0.000 0.000 4000.00

root@cahost root]# vi /etc/ntp.config
#uncommented lines in ntp.config
server 127.0.0.1
driftfile /etc/ntp/drift

on my client machines
[root@hostb root]# chkconfig ntpd on
[root@hostb root]# service ntpd start
ntpd: Synchronizing with time server: [FAILED]
Starting ntpd: [ OK ]
[root@hostb root]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
192.168.0.4 0.0.0.0 16 u 96 1024 0 0.000 0.000 4000.00

so what is the problem i cannot understand.
my server ip is:192.168.0.4
my client 1:192.168.0.2
my client 2:192.168.0.3

Why it is not synchronized ?

thank you ...

Quote:
Originally Posted by bulliver
Ok, wait. I re-read your post again...

You are starting the time server on the client machine, is that really what you want?
If you just want to sync your client to the server then you just have to do:

Code:
# ntpdate -b <timeserver-ip>
This is usually set up as a cron task, which you can run as often as you feel the need for (every hour is common...). Some distros (such as gentoo which I am using here) have an init script which basically sets this up for you. see if you have a service like 'ntp-client' or somesuch.

If I am again misunderstanding you and you really want to start the a time server then just do it like so:
Code:
# ntpd -u ntp:ntp
I was suggesting this because generally service scripts will send errors and output to /dev/null, making it difficult to debug.
 
Old 08-11-2006, 12:01 AM   #6
shamilson
LQ Newbie
 
Registered: Aug 2006
Posts: 11

Original Poster
Rep: Reputation: 0
For get to tell that these are the outputs when are run those commands which you provided. I run them on client machine.

[root@hostb root]# ntpdate -b 192.168.0.4
11 Aug 13:58:26 ntpdate[9173]: the NTP socket is in use, exiting
[root@hostb root]# ntpd -u ntp:ntp
ntpd: unknown option -u
usage: ntpd [ -abdgmnqx ] [ -c config_file ] [ -e e_delay ]
[ -f freq_file ] [ -k key_file ] [ -l log_file ]
[ -p pid_file ] [ -r broad_delay ] [ -s statdir ]
[ -t trust_key ] [ -v sys_var ] [ -V default_sysvar ]
[ -T chroot_dir ] [ -U server_user ]
[ -P fixed_process_priority ]

Last edited by shamilson; 08-11-2006 at 12:02 AM.
 
Old 08-11-2006, 12:11 AM   #7
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Quote:
root@cahost root]# vi /etc/ntp.config
#uncommented lines in ntp.config
server 127.0.0.1
OK, well I think your problem here is that you are telling your server to sync time with itself (127.0.0.1).
You first need to setup your server to get the correct time from a publically accessible upper stratum time server such as pool.ntp.org

You may also be able to find a local mirror, have a look here:
http://www.pool.ntp.org/

I think after you change:
Code:
server 127.0.0.1
to
Code:
server pool.ntp.org
your server will sync fine, and your clients will be able to sync from your server...
 
Old 08-11-2006, 12:14 AM   #8
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Quote:
ntpd: unknown option -u
Strange, we must have different versions...

Code:
[ -u user [: group ] ]
So mine is -u and yours is -U.
In any event, it should not matter if you configure your server to use a valid timeserver to sync with.
 
Old 08-11-2006, 01:12 AM   #9
shamilson
LQ Newbie
 
Registered: Aug 2006
Posts: 11

Original Poster
Rep: Reputation: 0
Hi,
I did as you told and my server started synchronizing. So below is output

[root@cahost root]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
popuserv.org 192.53.103.103 2 u 1 64 1 401.797 -5.513 0.008

BUT the PROBLEM is my client machines are not synchronized with my server. How to solve this one.Below is output.

[root@hostb root]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
192.168.0.4 0.0.0.0 16 u 34 64 0 0.000 0.000 4000.00


I configured my iptabels on my server as below, maybe they are preventing from synchronization ? Could you have a look.

iptables -t nat -L -v -n
iptables -t nat -A POSTROUTING --source 192.168.0.0/24 -j MASQUERADE
iptables -t filter -A INPUT --source 192.168.0.0/24 --in-interface eth0 -j DROP
iptables -t filter -A FORWARD --source 192.168.0.0/24 --in-interface eth0 -j DROP

my server ip is: 192.168.0.4 (eth1)
my client 1 ip is: 192.168.0.2
my client 2 ip is: 192.168.0.3

I need to synchronize my clients with the server because i want my server to issue a certificates to clients. So my server acts as an Certificate Authority.

What does prevent my client machines to be synchronized with server ?.

thank you ...
Quote:
Originally Posted by bulliver
Strange, we must have different versions...

Code:
[ -u user [: group ] ]
So mine is -u and yours is -U.
In any event, it should not matter if you configure your server to use a valid timeserver to sync with.
 
Old 08-11-2006, 01:17 AM   #10
shamilson
LQ Newbie
 
Registered: Aug 2006
Posts: 11

Original Poster
Rep: Reputation: 0
Thank you very much.
I got them my client machines are also now being synchronized with my server.

Thank you very much. The problem was i had to wait until my clients contacted the server.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ntpd time server problem MGrosskopf Linux - Networking 0 02-06-2005 08:57 AM
ntpd not correcting local time plythgam Linux - Software 1 08-16-2004 04:12 PM
synchonization tools? alaios Linux - Laptop and Netbook 1 05-03-2004 03:43 AM
NTPD time sync steps instead of slews ne1scott Linux - Software 0 04-13-2004 01:28 PM
Howto use ntpd time synchronization??? Schmurff Linux - Software 1 03-10-2004 11:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration