Results 1 to 9 of 9

Thread: How to make Ubuntu machine provide NTP time?

  1. #1
    Join Date
    Jun 2008
    Location
    New York, USA
    Beans
    781

    How to make Ubuntu machine provide NTP time?

    Hi,

    I'm running a NAS box built with Ubuntu Server 64 bit.

    Of course, it's running the NTP daemon and synchronizes it's time over the Internet.

    What I would like to do is additionally make my NAS box SERVE ntp time over my local intranet.

    I've searched Google and found a few "how-to" pages... but their procedures didn't work. All involved editing /etc/ntp.conf

    I know my NTP clients (i.e. Windows boxes) are working, because they can read and sync to, say, "time-a.nist.gov". But, if I try to sync to "192.168.0.11" (the IP of my NAS box) or it's network name ("storage") it fails.

    How can I make my Linux box SERVE it's time to other local clients?

    Thanks in advance!

    -- Roger
    Gentlemen may prefer Blondes, but Real Men prefer Redheads!

  2. #2
    Join Date
    Jun 2005
    Location
    Delhi, India
    Beans
    565
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: How to make Ubuntu machine provide NTP time?

    Read this.

    3) If this server is also going to provide time for other computers, such as PCs, other Linux servers and networking devices, then you'll have to define the networks from which this server will accept NTP synchronization requests. You do so with a modified restrict statement removing the noquery keyword to allow the network to query your NTP server. The syntax is:

    restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap


    In this case the mask statement has been expanded to include all 255 possible IP addresses on the local network.
    kagashe
    Acer Aspire 3 A315-21 with pre-installed Endless OS & Ubuntu 22.04 in dual boot
    Linux Registered User #395189
    Ubuntu user number # 345

  3. #3
    Join Date
    Oct 2004
    Location
    Thunder Bay Canada
    Beans
    277

    Re: How to make Ubuntu machine provide NTP time?

    Code:
    man ntpd
    will tell you the whole story.

  4. #4
    Join Date
    Jun 2008
    Location
    New York, USA
    Beans
    781

    Re: How to make Ubuntu machine provide NTP time?

    Quote Originally Posted by Seti View Post
    Code:
    man ntpd
    will tell you the whole story.
    Sorry... I've seen those links before (and more). I've tried the examples. They don't work for me.
    Gentlemen may prefer Blondes, but Real Men prefer Redheads!

  5. #5
    Join Date
    Jun 2008
    Location
    New York, USA
    Beans
    781

    Re: How to make Ubuntu machine provide NTP time?

    --nobody--?

    C'mon... this should be simple...
    Gentlemen may prefer Blondes, but Real Men prefer Redheads!

  6. #6
    Join Date
    Jun 2008
    Location
    New York, USA
    Beans
    781

    Re: How to make Ubuntu machine provide NTP time?

    Can anyone help me with this?

    I DID read all the suggested links and docs... I DID search Google until I went blind... I tried everything... nada.

    All I want to do is make my File Server box (which syncs it's time via NTP) also PROVIDE time to Windows boxes on my local Intranet.

    Am I missing a file or package? I only have "NTP" and "NTP-DOC" installed on my server. Do I need something else?

    The file server and Windows boxes are all connected to a firewall router. Our local, internal IP addresses are 192.168.0.10 and up. The router itself (as well as the DNS server) is at 192.168.0.1

    I'm sure all I need are a few small changes to /etc/ntp.conf... but everything I've tried didn't work.

    After each change, I did restart NTP using the command '/etc/init.d/ntp restart'. I also tried completely rebooting the whole server box. Nothing worked.

    Any help will be GREATLY appreciated (real help... not "see the docs" please).

    Thanks.

    -- Roger
    Gentlemen may prefer Blondes, but Real Men prefer Redheads!

  7. #7
    Join Date
    Nov 2007
    Location
    South African in London
    Beans
    1,098
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: How to make Ubuntu machine provide NTP time?

    ntpd daemon needs to be running.

    you then need to configure the windows boxes to get their time off your linux box, and not the internet

  8. #8
    Join Date
    Jun 2008
    Location
    New York, USA
    Beans
    781

    Re: How to make Ubuntu machine provide NTP time?

    Quote Originally Posted by mellowd View Post
    ntpd daemon needs to be running.

    you then need to configure the windows boxes to get their time off your linux box, and not the internet
    NTPD is running:

    Code:
    root@storage:/# ps -A | grep -i ntpd
     4965 ?        00:00:00 ntpd
    Here's my /etc/ntp.conf file (change I made in bold):

    Code:
    # /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help
    
    driftfile /var/lib/ntp/ntp.drift
    
    # Enable this if you want statistics to be logged.
    statsdir /var/log/ntpstats/
    
    statistics loopstats peerstats clockstats
    filegen loopstats file loopstats type day enable
    filegen peerstats file peerstats type day enable
    filegen clockstats file clockstats type day enable
    
    
    # You do need to talk to an NTP server or two (or three).
    server time-a.nist.gov
    server time-b.nist.gov
    server ntp.ubuntu.com
    server butler.acsu.buffalo.edu
    
    
    # Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for
    # details.  The web page <http://support.ntp.org/bin/view/Support/AccessRestrictions>
    # might also be helpful.
    #
    # Note that "restrict" applies to both servers and clients, so a configuration
    # that might be intended to block requests from certain clients could also end
    # up blocking replies from your own upstream servers.
    
    # By default, exchange time with everybody, but don't allow configuration.
    restrict -4 default kod notrap nomodify nopeer noquery
    restrict -6 default kod notrap nomodify nopeer noquery
    
    # Local users may interrogate the ntp server more closely.
    restrict 127.0.0.1
    restrict ::1
    
    # Clients from this (example!) subnet have unlimited access, but only if
    # cryptographically authenticated.
    #restrict 192.168.123.0 mask 255.255.255.0 notrust
    
    # If you want to provide time to your local subnet, change the next line.
    # (Again, the address is an example only.)
    broadcast 192.168.0.255
    
    # If you want to listen to time broadcasts on your local subnet, de-comment the
    # next lines.  Please do this only if you trust everybody on the network!
    #disable auth
    #broadcastclient

    Other computers on my local Intranet can't get time from the file server.
    Gentlemen may prefer Blondes, but Real Men prefer Redheads!

  9. #9
    Join Date
    Feb 2008
    Beans
    54

    Re: How to make Ubuntu machine provide NTP time?

    Krup

    Code:
    # Clients from this (example!) subnet have unlimited access, but only if
    # cryptographically authenticated.
    #restrict 192.168.123.0 mask 255.255.255.0 notrust
    change the directive to:

    Code:
    restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
    give it a try.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •