cancel
Showing results for 
Search instead for 
Did you mean: 

NTP "gateway"

SOLVED
Go to solution
Vitek Pepas
Valued Contributor

NTP "gateway"

I'd like to setup NTP so that one server on a subnet would synchronize itself to an external source, and then all other servers on that subnet would synchronize to my "gateway" server.
It is possible? Can the same machine be NTP server and client at the same time?
Thanks,

Vitek
3 REPLIES
Patrick Wallek
Honored Contributor
Solution

Re: NTP "gateway"

Absolutely. That is how I have my servers set up.

I have 2 NTP servers. They are set up like:

# cat /etc/ntp.conf
server tick.uh.edu # U of Houston
server ntp2.usno.navy.mil # US Naval Observatory
server ntp-cup.external.hp.com # HP
server time.twc.weather.com # The Weather Channel, Atlanta
server bonehed.lcs.mit.edu # MIT, Boston
peer timeserver2
driftfile /etc/ntp.drift


All the server lines are the time sources I sync to. The peer line is my other internal NTP box which also syncs to external time sources.

My ntp clients are set up like:

#cat /etc/ntp.conf
server timeserver1
server timeserver2
driftfile /etc/ntp.drift
David Burgess
Esteemed Contributor

Re: NTP "gateway"

Internet facing server (ip address x.x.x.x)
-------------------------------------------

This will talk to the clock at Manchester University in the UK.

/etc/ntp.conf

server ntp2a.mcc.ac.uk
server ntp2b.mcc.ac.uk
server ntp2c.mcc.ac.uk
server ntp2d.mcc.ac.uk

Start xntpd at boot - edit /etc/rc.config.d/netdaemons and point it at Manchester University

export NTPDATE_SERVER="ntp2a.mcc.ac.uk"
export XNTPD=1


Internal server (ip address y.y.y.y)
------------------------------------

statsdir /var/tmp/ntp
driftfile /var/adm/ntp.drift # path for drift file

server x.x.x.x
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10 # fudge to be a lower level stratum

driftfile /etc/ntp.drift


Start xntpd at boot - edit /etc/rc.config.d/netdaemons

XNTPD=1

Client
------

/etc/ntp.conf

server y.y.y.y

/etc/rc.config.d/netdaemons

export NTPDATE_SERVER="y.y.y.y"
export XNTPD=1

HTH.

Regards,

Dave.
rick jones
Honored Contributor

Re: NTP "gateway"

Pay careful note to the redundancy in those example configs. It is a very good thing (assume it to be required whenever possible) to have more than one NTP server at the different strata.

To think of the strata, think of say a family tree. The top strata are the grand family patriarchs that have the best, finest old pocketwatches that keep the best time. "Time" is served down the heirarchy in a tree fashion to make it most scalable.
there is no rest for the wicked yet the virtuous have no pillows