我有一个服务器: 192.168.0.40和4个客户端: 192.168.0.61-192.168.0.64。客户是覆盆子,所以没有实时时钟。因此,时间总是错误的。
我遵循了这里制作ntp.conf文件的指令:
服务器:
restrict default nomodify notrap noquery
restrict 127.0.0.1
# -- CLIENT NETWORK -------
restrict 192.168.0.0 mask 255.255.255.0 nomodify notrap
# --- OUR TIMESERVERS -----
server 0.pool.ntp.org iburst
server 1.pool.ntp.org iburst
server 2.pool.ntp.org iburst
server 127.127.1.0
# --- NTP MULTICASTCLIENT ---
# --- GENERAL CONFIGURATION ---
# Undisciplined Local Clock.
fudge 127.127.1.0 stratum 9
# Drift file.
driftfile /var/lib/ntp/drift
broadcastdelay 0.008
# Keys file.
keys /etc/ntp/keys客户:
restrict default nomodify notrap noquery
restrict 127.0.0.1
# -- CLIENT NETWORK -------
# --- OUR TIMESERVERS -----
# 192.168.1.2 is the address for my timeserver,
# use the address of your own, instead:
server 192.168.0.40 iburst
server 127.127.1.0
# --- NTP MULTICASTCLIENT ---
# --- GENERAL CONFIGURATION ---
# Undisciplined Local Clock.
fudge 127.127.1.0 stratum 12
# Drift file.
driftfile /var/lib/ntp/drift
broadcastdelay 0.008
# Keys file.
keys /etc/ntp/keys然而,客户端的时间仍然是错误的(与以前一样)。当我尝试具体连接到服务器时,客户端找不到它。他们是100%在同一子网和IP地址是正确的,因为我可以没有问题。
ntpq -c lpeer的结果是:
localhost: timed out, nothing received
***Request timed out编辑:
数独-u 192.168.0.40:
12 Dec 07:45:09 ntpdate[12815]: no server suitable for synchronization found编辑2:
客户端位于以太网上的子网上,服务器通过wifi连接。当wifi被禁用时,系统可以工作。有办法绕道吗?
发布于 2015-02-09 14:50:28
如果您更改网络设置,可能需要重新启动NTP (例如,SSH也会这样做)。您可以通过在服务器上使用netstat和在客户机上使用ntpdate来测试NTP是否已启动并侦听。
在服务器上:
$ sudo netstat -unlp | grep ntp
udp 0 0 192.168.122.1:123 0.0.0.0:* 2786/ntpd
udp 0 0 127.0.0.1:123 0.0.0.0:* 2786/ntpd
udp 0 0 0.0.0.0:123 0.0.0.0:* 2786/ntpd
udp6 0 0 fe80::4e72:b9ff:fe4:123 :::* 2786/ntpd
udp6 0 0 ::1:123 :::* 2786/ntpd
udp6 0 0 :::123 :::* 2786/ntpd 关于客户:
sudo ntpdate <server-ip/hostname>https://askubuntu.com/questions/583453
复制相似问题