• 配置Windows为NTP服务器


    建议使用 ntpd for windows,这是一个ntp的windows版,操作和linux相似

    下载:https://www.meinbergglobal.com/english/sw/ntp.htm#ntp_nt

    目前版本是ntp-4.2.8p7,经测试可以在win7上使用。

    1、下载安装,都很简单,下一步完成。

    2、配置,基本和linux差不多,安装应用目录

    点击Edit Ntp Configuration,进行ntp配置,参考linux配置

    #默认拒绝所有来源的任何访问
    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 <IP OF REMOTE HOST> 
    # 设置自己需要访问的网段地址
    restrict 10.102.145.0 mask 255.255.255.0 nomodify
    restrict 10.20.0.0 mask 255.255.0.0 nomodify
    
    # Use drift file 
    driftfile "C:Program Files (x86)NTPetc
    tp.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)
    # 按自己需求增加上层NTP服务器
    server 0.centos.pool.ntp.org prefer
    server 1.centos.pool.ntp.org
    server 2.centos.pool.ntp.org
    server us.npt.org.cn 
    
    # 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 10
    
    # End of generated ntp.conf --- Please edit this to suite your needs

    使用菜单中的Restart Ntp Server 重启服务。

    使用Quick NTP Status查看NTP服务的状态,其实就是 watch ntpq -p;如果如下图,基本就成功了

    然后就是你的服务器端设置了。

    下面再说下一些术语解释:

    # 1. 关于权限设定部分 
    #   权限的设定主要以 restrict 这个参数来设定,主要的语法为: 
    #   restrict IP mask netmask_IP parameter 
    #   其中 IP 可以是软件地址,也可以是 default ,default 就类似 0.0.0.0 
    #   至于 paramter 则有: 
    #   ignore :关闭所有的 NTP 联机服务 
    #   nomodify:表示 Client 端不能更改 Server 端的时间参数,不过,

    #   Client 端仍然可以透过 Server 端来进行网络校时。 
    #   notrust :该 Client 除非通过认证,否则该 Client 来源将被视为不信任网域 
    #   noquery :不提供 Client 端的时间查询

    #   notrap :不提供trap这个远程事件登入

    #  如果 paramter 完全没有设定,那就表示该 IP (或网域)“没有任何限制”

    restrict default nomodify notrap noquery # 关闭所有的 NTP 要求封包 
    restrict 127.0.0.1    #这是允许本级查询

    #在192.168.0.1/24网段内的服务器就可以通过这台NTP Server进行时间同步了 
    restrict 192.168.0.1 mask 255.255.255.0 nomodify 

    # 2. 上层主机的设定 
    #  要设定上层主机主要以 server 这个参数来设定,语法为:
    #  server [IP|HOST Name] [prefer]
    #  Server 后面接的就是我们上层 Time Server 啰!而如果 Server 参数 
    #  后面加上 perfer 的话,那表示我们的 NTP 主机主要以该部主机来作为 
    #  时间校正的对应。另外,为了解决更新时间封包的传送延迟动作, 
    #  所以可以使用 driftfile 来规定我们的主机 
    #  在与 Time Server 沟通时所花费的时间,可以记录在 driftfile  
    #  后面接的文件内,例如下面的范例中,我们的 NTP server 与  
    #  cn.pool.ntp.org联机时所花费的时间会记录在 /etc/ntp/drift文件内 
    server 0.pool.ntp.org

    server 1.pool.ntp.org

    :windows原生的做ntp服务不是很稳定,建议重要环境不要使用,不然要死翘翘

      1. 修改注册表项

      HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeTimeProvidersNtpServer

      Enabled 设定为 1(默认0)

      HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeConfig

      AnnounceFlags 设定为 5 (默认 10)

         2. 禁用防火墙或设置例外,UDP 123端口。

       3. 运行 services.msc,将Windows Time服务设置成自动(延迟启动)

    网络设备(如cisco、h3c交换机……)不能正常同步NTP服务器时间:
    HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeConfigLocalClockDispersion
    值修改为0 (默认为0x0000000a)
  • 相关阅读:
    关于正餐智能POS6.0.1.1改版后,点击反结账进入点菜界面后无法进行加菜的FAQ
    关于正餐智能POS6.0.1.1改版后,订单模块无法进行部分退款的FAQ
    退款证书相关
    简易付主副机和打印机配置
    秒点直连操作文档
    智能POS打印配置&常见问题FAQ 12-14 后期持续更新
    ERP主副机和打印机配置FAQ
    ASP.NET没有魔法——ASP.NET MVC Controller的实例化与执行
    ASP.NET没有魔法——ASP.NET MVC 路由的匹配与处理
    ASP.NET没有魔法——ASP.NET MVC路由
  • 原文地址:https://www.cnblogs.com/qpanda/p/5466332.html
Copyright © 2020-2023  润新知