Skip to content

Instantly share code, notes, and snippets.

@mzpqnxow
Created April 8, 2018 20:40
Show Gist options
  • Save mzpqnxow/0d0dc077a31c778016b3faa36d6883af to your computer and use it in GitHub Desktop.
Save mzpqnxow/0d0dc077a31c778016b3faa36d6883af to your computer and use it in GitHub Desktop.
Sample ntp.conf with whitelisting by host/network
riftfile /var/lib/ntp/ntp.drift
statsdir /var/log/ntpstats/
restrict default ignore
restrict 127.0.0.1
restrict 127.127.1.0
restrict -6 ::1
# You only want to allow a class 24 and two specific hosts to query your server for time
# These are 1.2.3.0/24, 4.5.6.7/32, 6.7.8.9/32
restrict -4 1.2.3.0 mask 255.255.255.0
restrict -4 4.5.6.7 mask 255.255.255.255
restrict -4 6.7.8.9 mask 255.255.255.255
server 0.pool.ntp.org iburst nomodify notrap nopeer noquery
restrict 0.pool.ntp.org iburst nomodify notrap nopeer noquery
server 1.pool.ntp.org iburst nomodify notrap nopeer noquery
server 2.pool.ntp.org iburst nomodify notrap nopeer noquery
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment