问题原文
原帖链接 · timlyo · CC BY-SA 3.0
I'm working through some tutorials for setting ntpd clock from gpsd. The guides that I'm working from list adding something like this:
server 127.127.46.0
fudge 127.127.46.0 time1 0.0 time2 0.0 refid GPS
to /etc/ntp.conf however every tutorial seems to use a different ip e.g. 127.127.28.0 or 127.127.40.0 etc.
What do these addresses correspond to, and how can I find out the correct one to use?
已采纳解答
原帖链接 · HBruijn · CC BY-SA 4.0
It seems that the loopback ip-address range 127.127.0.0/16 is used by NTPD to represent drivers for specific clocks. The third octet is the number of the specific driver as found on the list of drivers here and should probably correspond to either your actual clock or to how you want to interact with gpsd.
The fourth octet is the "unit number", which was originally meant to be used in case there were multiple devices on a system supported by the same driver, although in some cases it gets used differently.
As far as I can tell no driver actually connects over TCP/IP to that loopback address, it appears a NTPD quirk to name/represent drivers as loopback ip-addresses.
The pseudo IP-address 127.127.28.0 therefore indicates a specific driver in NTPD, specifically driver 28, the shared memory driver SHM and is one way gpsd and ntpd can interact.
127.127.46.0 denotes a different driver, driver 46, the GPSD NG client driver a specific client driver to interact with gpsd.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
