[ntp:questions] Synchronizing contrived time
mike cook
michael.cook at sfr.fr
Mon Mar 10 08:09:23 UTC 2014
Le 8 mars 2014 à 05:16, Amit Dor-Shifer a écrit :
> Hi.
> I'm wishing to setup some arbitrary time on host A, and have host B
> synchronize off A. I was considering ntp for that:
> 1. Set the desired time on A.
> 2. fire-up ntpd on A, but prevent it from synching against any external
> server.
just use the local clock 127.127.1.x for A's source.
muon# cat /etc/ntp.conf
server 127.127.1.0 minpoll 4 maxpoll 4
stop ntp on A
set the date manually
muon# date 8506131627
Thu Jun 13 16:27:00 CEST 1985
muon# /usr/local/bin/ntpd -c /etc/ntp.conf -p /var/run/ntpd.pid or wherever you find it
muon# ntpq -pn
remote refid st t when poll reach delay offset jitter
==============================================================================
*127.127.1.0 .LOCL. 5 l 12 16 1 0.000 0.000 0.008
muon# date
Thu Jun 13 16:32:29 CEST 1985
> 3. use an ntp client (ntpdate?) on B to sync to A's time.
> I'm stumbling on:
> a. the correct ntpd configuration on A.
> b. forcing B to sync off A: it seems the client drops the server,
> considering it as an unreliable source.
On B.
Mon Mar 10 08:51:42 CET 2014
rstop ntp if it is running on B
Stopping NTP server: ntpd.
root at raspberrypi:/home/mike# date
Mon Mar 10 08:52:11 CET 2014
get A's date
root at raspberrypi:/home/mike# ntpdate muon
13 Jun 16:29:10 ntpdate[20937]: step time server 192.168.1.4 offset -906917207.279748 sec
root at raspberrypi:/home/mike# date
Thu Jun 13 16:29:16 CEST 1985
you can start ntpd on B. Just reference A in ntp.conf
root at raspberrypi:/home/mike# cat /etc/ntp.conf
server muon minpoll 4 maxpoll 4
restart ntpd on B.
root at raspberrypi:/home/mike# /usr/bin/ntpd -c /etc/ntp.conf -p /var/run/ntpd.pid
root at raspberrypi:/home/mike# ntpq -pn
remote refid st t when poll reach delay offset jitter
==============================================================================
192.168.1.4 LOCAL(0) 6 u 9 16 1 1.084 -4.010 0.002
root at raspberrypi:/home/mike# date
Thu Jun 13 16:40:24 CEST 1985
root at raspberrypi:/home/mike# ntpq -pn
remote refid st t when poll reach delay offset jitter
==============================================================================
*192.168.1.4 LOCAL(0) 6 u 10 16 377 1.013 -10.238 4.158
So still running after 10 mins.
> Guidance appreciated, tnx :)
> _______________________________________________
> questions mailing list
> questions at lists.ntp.org
> http://lists.ntp.org/listinfo/questions
More information about the questions
mailing list