User Tools

Site Tools


ntp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ntp [2018/05/06 07:53] midas_zhountp [2025/10/14 06:22] (current) – external edit 127.0.0.1
Line 5: Line 5:
         option timezone CST-8         option timezone CST-8
    config timeserver ntp    config timeserver ntp
 +        list server     0.cn.pool.ntp.org
 +        list server     1.cn.pool.ntp.org
 +        list server     2.cn.pool.ntp.org
 +        list server     3.cn.pool.ntp.org
         list server     0.openwrt.pool.ntp.org         list server     0.openwrt.pool.ntp.org
         list server     1.openwrt.pool.ntp.org         list server     1.openwrt.pool.ntp.org
Line 13: Line 17:
  
 各选项说明: 各选项说明:
-      timezone      本机所在时区+      timezone      本机所在时区, Asian/Shanghai CST-8
       list server      NTP服务器列表,可以增删       list server      NTP服务器列表,可以增删
-      enabled        是否启用网络时间同步 +      enabled        是否启用网络时间同步, 1--启用; 0--停止。 
-      enable_server      本机是否作为NTP服务器+      enable_server        0--本机为授时客户端;1--本机设置为NTP中继服务器
    
 如果ntpd未启动,依次执行下面的命令来启动: 如果ntpd未启动,依次执行下面的命令来启动:
Line 22: Line 26:
    /etc/init.d/sysntpd start     (启动)    /etc/init.d/sysntpd start     (启动)
  
-连接NTP服务器可能需要等待一些时间, 最后执行date命令查看当前时间。+如果你需要立即同步时间,那么直接执行ntpd命令,比如: 
 +   ntpd -n -d -q -p 1.cn.pool.ntp.org 
 +连接NTP服务器和同步时间可能需要等待一些时间,直到出现" setting time to ...",此时时间同步完成。 
 +{{:ntpd.jpg}} 
 + 
 +最后执行date命令查看当前时间。
ntp.1525593233.txt.gz · Last modified: (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki