openwrt - ntp¶
NTP 用来使网络中的各个计算机时间同步的一种协议,它的用途是把系统的时钟同步到 UTC 时区,其精度在局域网内可达到 0.1ms,在互联网上绝大多数情况其精度可以达到1~50ms。
配置内容如下:
root@Thingoo:~# cat /etc/config/system
config system
option hostname Thingoo # 主机名
option timezone CST-8 # 时区
config timeserver ntp
list server 0.openwrt.pool.ntp.org # NTP 服务器地址
list server 1.openwrt.pool.ntp.org
list server 2.openwrt.pool.ntp.org
list server 3.openwrt.pool.ntp.org
option enabled 1 # 开启 NTP 功能
option enable_server 0
::: tip 提示
夏令时特殊时区 如Australia/Adelaide 需设置为:option timezone CST-9:30CST,M10.1.0,M4.1.0/3
解释。
timezone 选项: Posix 中使用的符号约定(±)与Internet时间偏移(RFC 3339)和Arthur David Olson中使用的符号约定相反。
:::