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
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1476532
Accepted
frankfalse
frankfalse
Asked: 2023-07-06 18:36:14 +0800 CST2023-07-06 18:36:14 +0800 CST 2023-07-06 18:36:14 +0800 CST

为什么timesyncd客户端没有收到NTP服务器的任何回复(回复超时)?

  • 772

在我的 lubuntu 22.04 中激活了该服务systemd-timesyncd。这是该服务的状态:

> systemctl status systemd-timesyncd

# this is the output of the previous command:
● systemd-timesyncd.service - Network Time Synchronization
     Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2023-07-06 12:21:43 CEST; 2min 54s ago
       Docs: man:systemd-timesyncd.service(8)
   Main PID: 1917 (systemd-timesyn)
     Status: "Idle."
      Tasks: 2 (limit: 2030)
     Memory: 1.3M
        CPU: 201ms
     CGroup: /system.slice/systemd-timesyncd.service
             └─1917 /lib/systemd/systemd-timesyncd

lug 06 12:21:55 ceia-te systemd-timesyncd[1917]: Timed out waiting for reply from 185.125.190.57:123 (ntp.ubuntu.com).
lug 06 12:22:05 ceia-te systemd-timesyncd[1917]: Timed out waiting for reply from 185.125.190.58:123 (ntp.ubuntu.com).
lug 06 12:22:15 ceia-te systemd-timesyncd[1917]: Timed out waiting for reply from 185.125.190.56:123 (ntp.ubuntu.com).
lug 06 12:22:25 ceia-te systemd-timesyncd[1917]: Timed out waiting for reply from 91.189.94.4:123 (ntp.ubuntu.com).

输出显示该服务正在运行并尝试连接到 NTP 服务器ntp.ubuntu.com,但没有收到任何回复(请参阅 messages Timed out waiting for reply from ntp.ubuntu.com);通过 ping 可以访问该服务器,我们可以通过以下命令的输出看到:

> ping ntp.ubuntu.com
PING ntp.ubuntu.com (91.189.94.4) 56(84) bytes of data.
64 bytes from pugot.canonical.com (91.189.94.4): icmp_seq=1 ttl=53 time=30.0 ms
64 bytes from pugot.canonical.com (91.189.94.4): icmp_seq=2 ttl=53 time=29.8 ms
64 bytes from pugot.canonical.com (91.189.94.4): icmp_seq=3 ttl=53 time=29.8 ms

防火墙iptables未激活:

> sudo iptables --list
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination 

有人可以告诉我为什么 timesyncd 客户端没有收到来自 NTP 服务器的任何回复吗ntp.ubuntu.com?

谢谢

networking
  • 1 1 个回答
  • 40 Views

1 个回答

  • Voted
  1. Best Answer
    frankfalse
    2023-07-06T21:08:36+08:002023-07-06T21:08:36+08:00

    问题出在互联网服务提供商身上

    感谢您的评论。我尝试连接到另一个网络,该网络能够通过我撰写帖子时使用的网络的其他方式连接到互联网。
    通过另一个网络并且无需对配置文件进行任何修改,/etc/systemd/timesyncd.conf即:

    [Time]
    #NTP=
    #FallbackNTP=ntp.ubuntu.com
    #RootDistanceMaxSec=5
    #PollIntervalMinSec=32
    #PollIntervalMaxSec=2048
    

    NTP客户端systemd timesyncd可以将系统日期同步到NTP服务器ntp.ubuntu.com。

    事实上服务的状态systemd-timesyncd.service如下:

    systemctl status systemd-timesyncd
    ● systemd-timesyncd.service - Network Time Synchronization
         Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
         Active: active (running) since Thu 2023-07-06 14:12:48 CEST; 46min ago
           Docs: man:systemd-timesyncd.service(8)
       Main PID: 2065 (systemd-timesyn)
         Status: "Initial synchronization to time server 185.125.190.56:123 (ntp.ubuntu.com)."
          Tasks: 2 (limit: 2030)
         Memory: 1.3M
            CPU: 203ms
         CGroup: /system.slice/systemd-timesyncd.service
                 └─2065 /lib/systemd/systemd-timesyncd
    
    lug 06 14:12:48 ceia-te systemd[1]: Starting Network Time Synchronization...
    lug 06 14:12:48 ceia-te systemd[1]: Started Network Time Synchronization.
    lug 06 14:12:13 ceia-te systemd-timesyncd[2065]: Initial synchronization to time server 185.125.190.56:123 (ntp.ubuntu.com).
    

    因此,无需对 lubuntu 配置进行任何修改,也无需安装任何其他软件包,系统即可正常工作。

    • 1

相关问题

  • 如何设置 VLAN 转发?

  • 如何将主机 Ubuntu 上的 VPN (tun0) 网络适配器映射到 VirtualBox 来宾 Windows?

  • 如何限制下载/上传带宽?

  • 如何通过 Windows 网络共享文件?

  • 面板小程序以文本形式显示当前网络流量?

Sidebar

Stats

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

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

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

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve