geppetto
Posts: 40
Joined: Mon Sep 19, 2011 8:03 am

Need a bit of help with NTP server

Thu Apr 18, 2013 7:02 pm

I'm playing with various things to get a bit more into Linux.
I've set up a Pi as a GPS NTP server and it's working fine.
It's on a home network and the NTP server Pi has a static ip of 192.168.0.30.

On the same network, I can tell my Windows 7 laptop to use that ip address as
it's internet time server and that also works fine.

However, I'm not sure how to tell a second Pi on the network to get it's time from the first Pi.

I'm assuming it's in the ntp.conf file of the client Pi where there are four internet addresses
for getting time online.
My little network wont be going online so what changes do I make to ntp.conf to get it to
get time from 192.168.0.30?
I presume I comment out the online server links and point the client Pi at the NTP server Pi somehow?

Total Linux noob but I'm getting there :D

Any help much appreciated

Philip

remsnet
Posts: 151
Joined: Wed Dec 19, 2012 7:32 pm
Location: Planet Gaia
Contact: Website Yahoo Messenger

Re: Need a bit of help with NTP server

Thu Apr 18, 2013 7:26 pm

geppetto wrote:I'm playing with various things to get a bit more into Linux.
I've set up a Pi as a GPS NTP server and it's working fine.
It's on a home network and the NTP server Pi has a static ip of 192.168.0.30.

On the same network, I can tell my Windows 7 laptop to use that ip address as
it's internet time server and that also works fine.

However, I'm not sure how to tell a second Pi on the network to get it's time from the first Pi.

I'm assuming it's in the ntp.conf file of the client Pi where there are four internet addresses
for getting time online.
My little network wont be going online so what changes do I make to ntp.conf to get it to
get time from 192.168.0.30?
I presume I comment out the online server links and point the client Pi at the NTP server Pi somehow?

Total Linux noob but I'm getting there :D

Any help much appreciated

Philip
On Windows

Code: Select all


1 . click on the Clock symbol
2. then "date and time "
3. then Internet Time
4. change the entry 
5 . save


On NTP Client RPI :

edit /etc/ntp.conf
add line

server <your ntp> iburst

my NTP "client" looks like this :

Code: Select all

cat /etc/ntp.conf
# This file was copied from /etc/ntp.conf with the server options changed
# to reflect the information sent by the DHCP server.  Any changes made
# here will be lost at the next DHCP event.  Edit /etc/ntp.conf instead.

# NTP server entries received from DHCP server
server 192.168.3.3 iburst
server 192.168.3.1 iburst

# /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


# 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


geppetto
Posts: 40
Joined: Mon Sep 19, 2011 8:03 am

Re: Need a bit of help with NTP server

Thu Apr 18, 2013 7:52 pm

You're a star for taking the trouble to post that...
Just what I needed to know and will try it out later..


Many many thanks

Regards Philip

remsnet
Posts: 151
Joined: Wed Dec 19, 2012 7:32 pm
Location: Planet Gaia
Contact: Website Yahoo Messenger

Re: Need a bit of help with NTP server

Thu Apr 18, 2013 8:06 pm

geppetto wrote:You're a star for taking the trouble to post that...
Just what I needed to know and will try it out later..

Many many thanks

Regards Philip

Thanks for the Star :o :D

my NTP Server used multible stratum1 sources

Code: Select all

cat /etc/ntp.conf

# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help

driftfile /var/lib/ntp/ntp.drift

server          127.127.1.0     # local clock
fudge           127.127.1.0 stratum 2

# 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

# dcf77 master
server ptbtime1.ptb.de iburst minpoll 3
restrict ptbtime1.ptb.de nomodify notrap mask 255.255.255.255

# dcf77 radio
server ntp1.fau.de iburst minpoll 3
restrict ntp1.fau.de nomodify notrap mask 255.255.255.255

#GPS , belgium
server ntp1.oma.be iburst minpoll 3
restrict ntp1.oma.be  nomodify notrap mask 255.255.255.255

# GPS, GLONASS, DCF, MSF, Zug, Switzerland
server ntp0.as34288.net  iburst minpoll 3
restrict ntp0.as34288.net   nomodify notrap mask 255.255.255.255

# local ( 2 ntp)
peer app2
restrict app2  192.168.3.0 mask 255.255.255.0

# 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.

restrict default ignore
# 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  subnet have unlimited access
restrict 192.168.3.0 mask 255.255.255.0 nomodify notr

geppetto
Posts: 40
Joined: Mon Sep 19, 2011 8:03 am

Re: Need a bit of help with NTP server

Fri Apr 19, 2013 8:14 pm

Got chance today to follow your suggestions
and it works like a dream...

Again, many thanks

Regards
Philip

Return to “Networking and servers”