Solved

Problem starting xntpd daemon on the server

Posted on 2004-11-01
1,277 Views
Last Modified: 2013-12-27
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
Question by:ebi168
    16 Comments
     
    LVL 38

    Expert Comment

    by:wesly_chen
    Hi,

    > driftfile /var/ntp/ntp.drift

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

    Wesly
    0
     

    Author Comment

    by:ebi168
    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
     
    LVL 40

    Accepted Solution

    by:
    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
     

    Author Comment

    by:ebi168
    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
     

    Author Comment

    by:ebi168
    What is a local master?
    0
     
    LVL 40

    Assisted Solution

    by:jlevie
    > So why 127.0.0.1 instead 127.127.1.0

    Because that IP is bound to the lo interface.
    0
     

    Author Comment

    by:ebi168
    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
     
    LVL 40

    Assisted Solution

    by:jlevie
    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
     
    LVL 38

    Assisted Solution

    by:yuzh
    >>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
     

    Author Comment

    by:ebi168
    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
     
    LVL 38

    Assisted Solution

    by:yuzh
    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
     

    Author Comment

    by:ebi168
    Yuzh: thanks for all the links.

    Does anyone know what is my problem with xntpd?

    0
     
    LVL 38

    Assisted Solution

    by:wesly_chen
    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
     

    Author Comment

    by:ebi168
    How would firewall, /etc/hosts file and ifconfig -a matter?
    0
     
    LVL 38

    Assisted Solution

    by:wesly_chen
    /etc/hosts and "ifconfig -a" is getting some information to understand your network configuration.

    Firewall on the host may block the ntpq.

    Wesly
    0
     

    Author Comment

    by:ebi168
    />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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Course: Foundations of Front-End Development

    Jump-start a lucrative career in front-end web development, with zero previous coding experience required. This course covers the basic programming concepts and languages required for creating engaging websites from scratch.

    Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
    Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
    In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
    This tutorial goes over how to archive and restore FreeBSD jails that are managed by ezjail.

    846 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

    5 Experts available now in Live!

    Get 1:1 Help Now