首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >NTP: Linux客户端不会与运行ntpd的Win7服务器(而不是w32time)同步。

NTP: Linux客户端不会与运行ntpd的Win7服务器(而不是w32time)同步。
EN

Server Fault用户
提问于 2015-12-15 23:43:26
回答 1查看 1.6K关注 0票数 4

我们有一个“bot”,它的Linux主机运行在一个只连接到Win7主机的内部网络上。Win7主机可以访问互联网,但Linux主机没有。(历史原因)

当我在win7框上从Meinberg加载NTPD时,它与网络服务器同步很好,(禁用了w32时间服务)。但是Linux客户端无法与该win7服务器同步。我的桌面Linux与互联网同步,也不能与win7服务器同步。

代码语言:javascript
复制
**trying from Linux to Windows**
root@os-linux:~# ntpdate -dvu 192.168.128.118
15 Dec 14:30:13 ntpdate[2124]: ntpdate 4.2.6p5@1.2349-o Fri Oct 23 16:45:28 UTC 2015 (1)
Looking for host 192.168.128.118 and service ntp
host found : robot-10424.ith.local
transmit(192.168.128.118)
transmit(192.168.128.118)
transmit(192.168.128.118)
transmit(192.168.128.118)
transmit(192.168.128.118)
192.168.128.118: Server dropped: no data
server 192.168.128.118, port 123
stratum 0, precision 0, leap 00, trust 000
refid [192.168.128.118], delay 0.00000, dispersion 64.00000
transmitted 4, in filter 4
reference time:    00000000.00000000  Sun, Dec 31 1899 16:00:00.000
originate timestamp: 00000000.00000000  Sun, Dec 31 1899 16:00:00.000
transmit timestamp:  da1b12fb.91411c7f  Tue, Dec 15 2015 14:30:19.567
filter delay:  0.00000  0.00000  0.00000  0.00000 
         0.00000  0.00000  0.00000  0.00000 
filter offset: 0.000000 0.000000 0.000000 0.000000
         0.000000 0.000000 0.000000 0.000000
delay 0.00000, dispersion 64.00000
offset 0.000000
15 Dec 14:30:21 ntpdate[2124]: no server suitable for synchronization found

这里是win7 (NTPD服务器)内容.

代码语言:javascript
复制
# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help

driftfile /var/lib/ntp/ntp.drift


# Enable this if you want statistics to be logged.
#statsdir /var/log/ntpstats/

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

# Specify one or more NTP servers.

# Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board
# on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for
# more information.
#server 0.ubuntu.pool.ntp.org
#server 1.ubuntu.pool.ntp.org
#server 2.ubuntu.pool.ntp.org
#server 3.ubuntu.pool.ntp.org
server 192.168.128.118
# Use Ubuntu's ntp server as a fallback.
server ntp.ubuntu.com

# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for
# details.  The web page <http://support.ntp.org/bin/view/Support/AccessRestrictions>
# might also be helpful.
#
# Note that "restrict" applies to both servers and clients, so a configuration
# that might be intended to block requests from certain clients could also end
# up blocking replies from your own upstream servers.

# 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

# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1

# Clients from this (example!) subnet have unlimited access, but only if
# cryptographically authenticated.
#restrict 192.168.123.0 mask 255.255.255.0 notrust


# If you want to provide time to your local subnet, change the next line.
# (Again, the address is an example only.)
#broadcast 192.168.123.255

# If you want to listen to time broadcasts on your local subnet, de-comment the
# next lines.  Please do this only if you trust everybody on the network!
#disable auth
#broadcastclient

win7 ntp.conf

代码语言:javascript
复制
# NTP Network Time Protocol 
# **** ATTENTION ****: *You have to restart the NTP service when you change this file to activate the changes* 
# PLEASE CHECK THIS FILE CAREFULLY AND MODIFY IT IF REQUIRED 
# Configuration File created by Windows Binary Distribution Installer Rev.: 1.27  mbg
# please check http://www.ntp.org for additional documentation and background information
# restrict access to avoid abuse of NTP for traffic amplification attacks 
# see http://news.meinberg.de/244 for details  
#restrict default noquery nopeer nomodify notrap  
#restrict -6 default noquery nopeer nomodify notrap  

# allow status queries and everything else from localhost 
restrict 127.0.0.1 
restrict -6 ::1 

# if you need to allow access from a remote host, you can add lines like this: 
restrict 192.168.128.36 mask 255.255.0.0 

# Use drift file 
driftfile "c:\Program Files\NTP\etc\ntp.drift"

# your local system clock, could be used as a backup
# (this is only useful if you need to distribute time no matter how good or bad it is)
#server 127.127.1.0
# but it should operate at a high stratum level to let the clients know and force them to
# use any other timesource they may have.
#fudge 127.127.1.0 stratum 12

# Use a NTP server from the ntp pool project (see http://www.pool.ntp.org)
# Please note that you need at least four different servers to be at least protected against
# one falseticker. If you only rely on internet time, it is highly recommended to add
# additional servers here. 
# The 'iburst' keyword speeds up initial synchronization, please check the documentation for more details!
 server 0.pool.ntp.org iburst minpoll 6 maxpoll 7
 server 1.pool.ntp.org iburst minpoll 6 maxpoll 7
 server 2.pool.ntp.org iburst minpoll 6 maxpoll 7
 server 3.pool.ntp.org iburst minpoll 6 maxpoll 7
 server 4.pool.ntp.org iburst minpoll 6 maxpoll 7

# Use specific NTP servers
server 3.north-america.pool.ntp.org iburst minpoll 6 maxpoll 7
EN

回答 1

Server Fault用户

发布于 2015-12-16 17:27:41

谢谢Ryan,ntpd必须添加到windows防火墙的列表中。事后看来是显而易见的,但我想对windows新手来说不是这样。

票数 2
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/743295

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档