[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1352
  • Last Modified:

Problem starting xntpd daemon on the server

Hi,

I have created ntp.conf for the server and client, after running xntpd start on both server and client, I only see xntpd process running on the client not the server (ps -ef | grep xntpd). Could anyone tell me what is the problem?

ntp.conf on server:

server 127.127.1.0 prefer
fudge 127.127.1.0 stratum 0

broadcast 224.0.1.1 ttl 4

enable auth monitor
driftfile /var/ntp/ntp.drift
statsdir /var/ntp/ntpstats/
filegen peerstats file peerstats type day enable
filegen loopstats file loopstats type day enable
filegen clockstats file clockstats type day enable

keys /etc/inet/ntp.keys
trustedkey 0
requestkey 0
controlkey 0

ntp.conf on the client:

server x.x.x.x
multicastclient 224.0.1.1

Thanks
0
ebi168
Asked:
ebi168
  • 8
  • 3
  • 3
  • +1
7 Solutions
 
wesly_chenCommented:
Hi,

> driftfile /var/ntp/ntp.drift

Do you create "/var/ntp/ntp.drift" with "0.0" in it?

Wesly
0
 
ebi168Author Commented:
What is the drift file used for? I created the ntp.drift file, run: /etc/init.d/xntpd start -c /etc/inet/ntp.conf

But the process is still not up.
0
 
jlevieCommented:
Your config tends to suggest that you are trying to create a local master. I'd suggest using:

server 127.0.0.1 prefer
fudge 127.0.0.1 stratum 0

which is the IP assigned to the localhost interface.
0
Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

 
ebi168Author Commented:
I tried
server 127.0.0.1 prefer
fudge 127.0.0.1 stratum 0

It start working. So why 127.0.0.1 instead 127.127.1.0?

When I run ntpq, I got error on both server and client:

# ntpq
ntpq> peers
localhost: timed out, nothing received
***Request timed out

Thanks
0
 
ebi168Author Commented:
What is a local master?
0
 
jlevieCommented:
> So why 127.0.0.1 instead 127.127.1.0

Because that IP is bound to the lo interface.
0
 
ebi168Author Commented:
Then what is a local master? With 127.0.0.1, what clock is the server sync to?

Why I am having problem using ntpq?

Thanks
0
 
jlevieCommented:
When you bind NTP to a local IP with a stratum of 0 instead of an Internet timekeeper you are creating a local master. That's useful when you don't have a full time Internet connection but still need all of the clients to have the same time. The clock may not be correct in the absolute sense, but they'll all be the same.

On the local master what does 'peers' with the server IP set to 127.0.0.1 show now?
0
 
yuzhCommented:
>>what clock is the server sync to?

For your local NTP master, you can get the correct time from a external host, eg, you
what your server to get the correct time from an external hosts (IP xxx.xxx.xx.x), you
can put something like the following in your crontab.

10 3,15 * * * /usr/sbin/ntpdate xxx.xxx.xx.x >/dev/null 2>&1

you local NTP clients will get time from your server.


0
 
ebi168Author Commented:
Jlevie:
Both server and client still show:

localhost: timed out, nothing received
***Request timed out


yuzh: But isn't it that once you ran xntpd, you can't use ntpdate any longer.

0
 
yuzhCommented:
Sorry, I didn't think, a memory bug in my head!

But you can create a startup script to run ntpdate before the system start to run
/etc/rc2.d/S74xntpd.

The proper way to do it is to allow this NTP server to synchronize with public time server.

Add one or more servers to  ntp.conf file, your server becomes a client of the refrence Server.

Have a look at the following FAQ:

http://www.ntp.org/ntpfaq/NTP-a-faq.htm

and:
http://www.sunmanagers.org/pipermail/sunmanagers/2003-August/024460.html
http://alimunix.ddns.comp.nus.edu.sg/docs/bk04ch08s03.html

for NTP server and client setup:
http:Q_20879113.html
0
 
ebi168Author Commented:
Yuzh: thanks for all the links.

Does anyone know what is my problem with xntpd?

0
 
wesly_chenCommented:
Hi,

> ntpq> peers
> localhost: timed out, nothing received
> ***Request timed out

Do you have any firewall software (such IPF) running on your ntpd server?
Turn off the firewall first.

Also, can you provide the /etc/hosts and the output of "ifconfig -a"?

Wesly
0
 
ebi168Author Commented:
How would firewall, /etc/hosts file and ifconfig -a matter?
0
 
wesly_chenCommented:
/etc/hosts and "ifconfig -a" is getting some information to understand your network configuration.

Firewall on the host may block the ntpq.

Wesly
0
 
ebi168Author Commented:
/>ifconfig -a
lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
ge0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
        inet x.x.x.x netmask ff000000 broadcast 10.255.255.255
        ether 0:3:ba:b:42:e2
ge0:1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
        inet y.y.y.y netmask ff000000 broadcast 10.255.255.255

x.x.x.x and y.y.y.y are the two ip address accessible to the server.

/etc/hosts are just all the ip addresses and host names pairs.

I need to research on how to find out whether the firewall is installed.

Thanks
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 8
  • 3
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now