AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / computer / 问题 / 1656240
Accepted
Erhannis
Erhannis
Asked: 2021-06-12 12:49:42 +0800 CST2021-06-12 12:49:42 +0800 CST 2021-06-12 12:49:42 +0800 CST

NTP 服务器,端口未打开

  • 772

因此,我正在尝试在这台 Windows 10 家庭计算机上安装 NTP 服务器。我尝试了各种教程来启用 w32time 的服务器模式,然后当失败时我最终安装了Meinberg NTP,但无济于事。所以事情是这样的:服务声称它们工作正常,但 NTP 端口 (123) 仍然关闭。我已经关闭了防火墙。我没有安装我所知道的其他安全软件。这是一个日志:(请注意,由于我重新启动了计算机,因此该服务在日志文件的中间停止并启动。)

C:\Program Files (x86)\NTP>cat log\log.log
11 Jun 15:30:36 ntpd[3228]: ntpd 4.2.8p15-o Jun 25 14:45:34 (UTC+02:00) 2020  (2): Starting
11 Jun 15:30:36 ntpd[3228]: Command line: C:\Program Files (x86)\NTP\bin\ntpd.exe -U 3 -M -g -c C:\Program Files (x86)\NTP\etc\ntp.conf -l C:\Program Files (x86)\NTP\log\log.log
11 Jun 15:30:36 ntpd[3228]: ----------------------------------------------------
11 Jun 15:30:36 ntpd[3228]: ntp-4 is maintained by Network Time Foundation,
11 Jun 15:30:36 ntpd[3228]: Inc. (NTF), a non-profit 501(c)(3) public-benefit
11 Jun 15:30:36 ntpd[3228]: corporation.  Support and training for ntp-4 are
11 Jun 15:30:36 ntpd[3228]: available at https://www.nwtime.org/support
11 Jun 15:30:36 ntpd[3228]: ----------------------------------------------------
11 Jun 15:30:36 ntpd[3228]: Raised to realtime priority class
11 Jun 15:30:36 ntpd[3228]: Clock interrupt period 15.625 msec
11 Jun 15:30:36 ntpd[3228]: Performance counter frequency 10.000 MHz
11 Jun 15:30:36 ntpd[3228]: proto: precision = 0.100 usec (-23)
11 Jun 15:30:36 ntpd[3228]: basedate set to 2020-06-18
11 Jun 15:30:36 ntpd[3228]: gps base set to 2020-06-21 (week 2111)
11 Jun 15:30:36 ntpd[3228]: Listen and drop on 0 v6wildcard [::]:123
11 Jun 15:30:36 ntpd[3228]: Listen and drop on 1 v4wildcard 0.0.0.0:123
11 Jun 15:30:36 ntpd[3228]: Listen normally on 2 Wi-Fi [fe80::c99b:cdce:96ea:21bf%14]:123
11 Jun 15:30:36 ntpd[3228]: Listen normally on 3 Wi-Fi 192.168.1.153:123
11 Jun 15:30:36 ntpd[3228]: Listen normally on 4 Loopback Pseudo-Interface 1 [::1]:123
11 Jun 15:30:36 ntpd[3228]: Listen normally on 5 Loopback Pseudo-Interface 1 127.0.0.1:123
11 Jun 15:34:13 ntpd[3228]: SCM requests stop (system shutdown)
11 Jun 15:34:13 ntpd[3228]: ntservice: The Network Time Protocol Service is stopping.
11 Jun 15:34:36 ntpd[4696]: ntpd 4.2.8p15-o Jun 25 14:45:34 (UTC+02:00) 2020  (2): Starting
11 Jun 15:34:36 ntpd[4696]: Command line: C:\Program Files (x86)\NTP\bin\ntpd.exe -U 3 -M -g -c C:\Program Files (x86)\NTP\etc\ntp.conf -l C:\Program Files (x86)\NTP\log\log.log
11 Jun 15:34:36 ntpd[4696]: ----------------------------------------------------
11 Jun 15:34:36 ntpd[4696]: ntp-4 is maintained by Network Time Foundation,
11 Jun 15:34:36 ntpd[4696]: Inc. (NTF), a non-profit 501(c)(3) public-benefit
11 Jun 15:34:36 ntpd[4696]: corporation.  Support and training for ntp-4 are
11 Jun 15:34:36 ntpd[4696]: available at https://www.nwtime.org/support
11 Jun 15:34:36 ntpd[4696]: ----------------------------------------------------
11 Jun 15:34:36 ntpd[4696]: Raised to realtime priority class
11 Jun 15:34:36 ntpd[4696]: Clock interrupt period 15.625 msec
11 Jun 15:34:36 ntpd[4696]: Performance counter frequency 10.000 MHz
11 Jun 15:34:36 ntpd[4696]: proto: precision = 0.200 usec (-22)
11 Jun 15:34:36 ntpd[4696]: basedate set to 2020-06-18
11 Jun 15:34:36 ntpd[4696]: gps base set to 2020-06-21 (week 2111)
11 Jun 15:34:36 ntpd[4696]: Listen and drop on 0 v6wildcard [::]:123
11 Jun 15:34:36 ntpd[4696]: Listen and drop on 1 v4wildcard 0.0.0.0:123
11 Jun 15:34:36 ntpd[4696]: Listen normally on 2 Loopback Pseudo-Interface 1 [::1]:123
11 Jun 15:34:36 ntpd[4696]: Listen normally on 3 Loopback Pseudo-Interface 1 127.0.0.1:123
11 Jun 15:34:42 ntpd[4696]: Listen normally on 4 Wi-Fi [fe80::c99b:cdce:96ea:21bf%14]:123
11 Jun 15:34:42 ntpd[4696]: Listen normally on 5 Wi-Fi 192.168.1.153:123

C:\Program Files (x86)\NTP>nmap -p 123 localhost
Starting Nmap 7.91 ( https://nmap.org ) at 2021-06-11 15:35 Central Daylight Time
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00s latency).
Other addresses for localhost (not scanned): ::1

PORT    STATE  SERVICE
123/tcp closed ntp

Nmap done: 1 IP address (1 host up) scanned in 0.19 seconds

C:\Program Files (x86)\NTP>nmap -p 123 127.0.0.1
Starting Nmap 7.91 ( https://nmap.org ) at 2021-06-11 15:35 Central Daylight Time
Nmap scan report for 127.0.0.1
Host is up (0.00s latency).

PORT    STATE  SERVICE
123/tcp closed ntp

Nmap done: 1 IP address (1 host up) scanned in 0.17 seconds

C:\Program Files (x86)\NTP>nmap -p 123 192.168.1.153
Starting Nmap 7.91 ( https://nmap.org ) at 2021-06-11 15:35 Central Daylight Time
Nmap scan report for DESKTOP-CL2NMV9.lan (192.168.1.153)
Host is up (0.00s latency).

PORT    STATE  SERVICE
123/tcp closed ntp

Nmap done: 1 IP address (1 host up) scanned in 0.19 seconds

C:\Program Files (x86)\NTP>

该服务声称在许多地址上侦听端口 123,并 netstat -abn同意 ntpd.exe 在许多地址上侦听 123,但 nmap 相反地表示在我尝试的每个本地指向地址上都关闭了 123。谁能解释为什么?

windows port
  • 1 1 个回答
  • 1024 Views

1 个回答

  • Voted
  1. Best Answer
    user1686
    2021-06-12T12:59:47+08:002021-06-12T12:59:47+08:00

    默认情况下,nmap 测试 TCP 端口。NTP 协议只使用UDP,ntpd 服务只设置 UDP 套接字,不设置 TCP。

    它们不会以任何方式进行交互——探测 TCP 端口 123 绝对不会告诉您正在侦听 UDP 端口 123 的内容,反之亦然。


    此外,即使您可以要求 nmap 扫描 UDP,它也不会像 TCP 那样可靠。

    在 TCP 中,如果您可以在 TCP 级别建立连接,那么您已经可以判断端口绝对是“开放”还是“关闭”,然后才开始讨论应用层协议。也就是说,你要么收到一个肯定的握手包(SYN-ACK),要么收到一个否定的(RST),或者什么都没有,但是你从 TCP 本身学到了这一点。(Nmap 的--reason选项会更详细地显示这一点。)

    另一方面,在 UDP 中,没有单独的连接建立——您发送任何数据包,它都会直接发送到相关服务。因此,如果您发送 NTP 数据包并收到响应,您肯定知道端口在所有意义上都是“开放的”。但是,如果您发送的不是NTP 数据包而只是通用探测,那么服务可能会选择不回复!

    因此,对于 UDP,您无法区分“没有回复,因为侦听器选择忽略您的垃圾数据包”与“没有回复,因为没有任何东西在侦听” 1与“没有回复,因为防火墙在数据包到达侦听器之前丢弃了数据包”。

    要确定是否存在 UDP 套接字,请使用netstat; 并确定套接字是否响应有效的 NTP 查询,使用实际的 NTP 客户端(例如ntpdate -q、sntp或w32tm /monitor)。

    1(理论上,如果没有监听 UDP 端口,您通常会收到 ICMP“端口不可达”错误。实际上,Windows 防火墙在所谓的“隐身模式”下运行,没有监听器的端口不会产生任何完全响应,无论是 TCP 的 RST 还是 UDP 的 ICMP,即使规则允许该端口。如果需要,可以禁用它。)

    • 2

相关问题

  • 如何在 Windows Precision 触摸板上禁用鼠标加速?

  • 批量重命名图像文件集

  • Python 的“pass”参数的批处理等价物是什么?

  • 在 Windows 上与 Docker 守护进程通信

  • 资源管理器侧面板中的桌面外壳快捷方式

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何减少“vmmem”进程的消耗?

    • 11 个回答
  • Marko Smith

    从 Microsoft Stream 下载视频

    • 4 个回答
  • Marko Smith

    Google Chrome DevTools 无法解析 SourceMap:chrome-extension

    • 6 个回答
  • Marko Smith

    Windows 照片查看器因为内存不足而无法运行?

    • 5 个回答
  • Marko Smith

    支持结束后如何激活 WindowsXP?

    • 6 个回答
  • Marko Smith

    远程桌面间歇性冻结

    • 7 个回答
  • Marko Smith

    子网掩码 /32 是什么意思?

    • 6 个回答
  • Marko Smith

    鼠标指针在 Windows 中按下的箭头键上移动?

    • 1 个回答
  • Marko Smith

    VirtualBox 无法以 VERR_NEM_VM_CREATE_FAILED 启动

    • 8 个回答
  • Marko Smith

    应用程序不会出现在 MacBook 的摄像头和麦克风隐私设置中

    • 5 个回答
  • Martin Hope
    Saaru Lindestøkke 为什么使用 Python 的 tar 库时 tar.xz 文件比 macOS tar 小 15 倍? 2021-03-14 09:37:48 +0800 CST
  • Martin Hope
    CiaranWelsh 如何减少“vmmem”进程的消耗? 2020-06-10 02:06:58 +0800 CST
  • Martin Hope
    Jim Windows 10 搜索未加载,显示空白窗口 2020-02-06 03:28:26 +0800 CST
  • Martin Hope
    v15 为什么通过电缆(同轴电缆)的千兆位/秒 Internet 连接不能像光纤一样提供对称速度? 2020-01-25 08:53:31 +0800 CST
  • Martin Hope
    andre_ss6 远程桌面间歇性冻结 2019-09-11 12:56:40 +0800 CST
  • Martin Hope
    Riley Carney 为什么在 URL 后面加一个点会删除登录信息? 2019-08-06 10:59:24 +0800 CST
  • Martin Hope
    zdimension 鼠标指针在 Windows 中按下的箭头键上移动? 2019-08-04 06:39:57 +0800 CST
  • Martin Hope
    jonsca 我所有的 Firefox 附加组件突然被禁用了,我该如何重新启用它们? 2019-05-04 17:58:52 +0800 CST
  • Martin Hope
    MCK 是否可以使用文本创建二维码? 2019-04-02 06:32:14 +0800 CST
  • Martin Hope
    SoniEx2 更改 git init 默认分支名称 2019-04-01 06:16:56 +0800 CST

热门标签

windows-10 linux windows microsoft-excel networking ubuntu worksheet-function bash command-line hard-drive

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve