[Enterprise SONiC] NTP (Network Time Protocol) Follow
NTP(Netowk time protocol ), assist devices on the network to synchronize time with a time server
Tested model & firmware version:
- Switch model name:
AS7326-56X
AS7726-32X
AS7816-64X
- Edgecore SONiC version:
202006.3
202006.4
202012.1
202012.2
202111.3
Restriction:
Restriction:
- NTP command only supports IP address, not URL.
- Regardless of whether the management VRF is enabled or disabled, the source interface can only be eth0.
-
Known issue :
- If management IP gets from DHCP server, NTP won’t work well to sync with the remote NTP server. SONiC will request the NTP service by loopback interface
- [SONIC-1851] In the current version, if you use “config load” to add an NTP server configuration, it will not restart the NTP service and apply the new configuration. You can use the workaround to restart ntp-config daemon after “config load”.(The issue is fixed in 2006.3)
admin@SW3:~$ sudo systemctl restart ntp-config
- [SONIC-3006] If Loopback interface (i.e Loopback0) exists, NTP has to specify "source interface". This enhancement is included as of 202012.2. For example: eth0 as source interface.
"NTP": {
"global": {
"src_intf": "eth0"
}
},
Sync the time with remote NTP server
Procedure:
Step 1. Configure IP address to network communication (Refer to Management and front port IPv4/IPv6 Address)
Step 2. Add the NTP server via the command line.
admin@sonic:~$ sudo config ntp add 216.239.35.12
Caution: Since Restriction #1, we cannot set the URL via the command line. But we can set the URL via editing config_db.json.
admin@sonic:/etc/sonic$ sudo vi config_db.json { ...omitted "NTP_SERVER": { "1.debian.pool.ntp.org": {}, "time.google.com": {}, "216.239.35.12": {} }, ...omitted }
Apply the config_db.json.
admin@sonic:~$ sudo config reload -y
Step 3. List all the timezone information.
admin@sonic:~$ sudo timedatectl list-timezones
Note: Use the arrow key to roll up and down, press “Space” for the next page, “q” for quit.
Step 4. Modify to your timezone.
admin@sonic:~$ sudo timedatectl set-timezone Asia/Taipei
Result:
- Check the system time by linux command
admin@sonic:~$ date Thu 31 Dec 2020 02:48:24 PM CST
- Check the synchronization status with the remote time server
admin@sonic:~$ show ntp MGMT_VRF_CONFIG is not present. synchronised to NTP server (216.239.35.12) at stratum 2 time correct to within 944 ms polling server every 64 s remote refid st t when poll reach delay offset jitter ============================================================================== *216.239.35.12 .GOOG. 1 u 36 64 7 5.489 -0.489 0.228
Comments
0 comments
Please sign in to leave a comment.