Skip to content

Instantly share code, notes, and snippets.

@tosihisa
Last active Aug 29, 2015
Embed
What would you like to do?
Raspberry Pi で NTP Stratum-1 Server を作るための ntpd 設定.IPv6 の設定は外していることに注意(IPv6 はルータで弾いている)
--- /etc/ntp_orig.conf 2014-02-09 02:40:48.108324421 +0000
+++ /etc/ntp.conf 2014-03-01 04:32:53.926990869 +0000
@@ -4,24 +4,32 @@
# Enable this if you want statistics to be logged.
-#statsdir /var/log/ntpstats/
+statsdir /var/log/ntpstats/
-statistics loopstats peerstats clockstats
+#statistics loopstats peerstats clockstats
+statistics loopstats sysstats
filegen loopstats file loopstats type day enable
-filegen peerstats file peerstats type day enable
-filegen clockstats file clockstats type day enable
+filegen sysstats file sysstats type day enable
+#filegen peerstats file peerstats type day enable
+#filegen clockstats file clockstats type day enable
# You do need to talk to an NTP server or two (or three).
#server ntp.your-provider.example
+# GPS NMEA
+# ポールインターバルは 2の4乗で16秒.
+server 127.127.20.0 mode 17 minpoll 4 maxpoll 4 prefer
+fudge 127.127.20.0 refid GPS
+fudge 127.127.20.0 flag1 1 flag3 1
+
# pool.ntp.org maps to about 1000 low-stratum NTP servers. Your server will
# pick a different set every time it starts up. Please consider joining the
# pool: <http://www.pool.ntp.org/join.html>
-server 0.debian.pool.ntp.org iburst
-server 1.debian.pool.ntp.org iburst
-server 2.debian.pool.ntp.org iburst
-server 3.debian.pool.ntp.org iburst
+#server 0.debian.pool.ntp.org iburst
+#server 1.debian.pool.ntp.org iburst
+#server 2.debian.pool.ntp.org iburst
+#server 3.debian.pool.ntp.org iburst
# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for
@@ -34,11 +42,11 @@
# 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
+#restrict -6 default kod notrap nomodify nopeer noquery
# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
-restrict ::1
+#restrict ::1
# Clients from this (example!) subnet have unlimited access, but only if
# cryptographically authenticated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment