大网数据广告活动
服务器运维问答

Getting gpsd address for ntpd

· 52CE 我爱测

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 …

问题原文

原帖链接 · 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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-03-29)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0 / CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。