Setting up an NTP server

First, make sure your system has the right time itself. You should therefore have the ntp or ntpd package installed and configured as a client.

Now simply add a restrict line without nopeer nor noquery against the subnetwork you want to. The additional mode7 is required for the deprecated ntpdc client program to work.

vi /etc/ntp.conf

restrict x.x.x.x mask nomodify notrap
restrict ::1
enable mode7

Don’t forget to setup the local clock as a fail-over, if internet connection goes down, so you still provide the service,

server # local clock
fudge stratum 10

#server     # LCL, local clock
#fudge stratum 12  # increase stratum

and also don’t forget to run hwclock --utc --systohc once in a while.

restart ntpd and call the local daemon (mode7),

ntpdc -l
ntpdc -c sysinfo


How to Install and Configure Linux NTP Server and Client

\7. Reference Clocks

Reference Clock Support

enable mode7

Reference Clock Commands and Options

Undisciplined Local Clock

ntpdc - special NTP query program

Network Time Protocol (NTP)

14.6. Basic NTP configuration

HOWTO ensure your clock is accurate and showing the correct time using the Network Time Protocol

6.3. Various Tricks

ntp.conf — Network Time Protocol (NTP) daemon configuration file format

The NTP “ntpdc” shell command “peers” returns “localhost: timed out, nothing received”

Nethence | Pub | Lab | Pbraun | SNE Russia | xhtml