Command Line Reference
System Configuration
Time Configuration
24 min
time time time view time view table 1 time view table 1 time view true 235,371#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type show clock show clock \[command] show clock \[purpose] display the time zone and time of the system \[view] privileged user view \[use cases] sonic# show clock 2024 10 19 09 19 01 tuesday utc+0000 show supported timezones show supported timezones \[command] show supported timezones \[purpose] display the time zones the system supports \[view] privileged user view \[use cases] sonic# show supported timezones time config time config table 2 time config table 2 time config true 239,367#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type clock datetime clock datetime date time \[command] clock datetime date time \[purpose] set the system time \[parameters] true 183,423#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type \[view] global configuration view \[use cases] sonic# configure sonic(config)# clock datetime 2022 02 22 20 30 30 clock timezone clock timezone zone \[command] clock timezone zone \[purpose] set the system time zone \[parameters] true 190,416#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type \[view] global configuration view \[notes] run command no clock timezone to restore the system time zone to default \[use cases] sonic# configure sonic(config)# clock timezone asia/shang ntp ntp ntp(network time protocol)is a protocol used to synchronize the time of individual machines on a network ntp view ntp view table 3 ntp view table 3 ntp view true 270,336#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type show ntp show ntp \[command] show ntp \[purpose] display ntp status \[view] privileged user view \[use cases] sonic# show ntp remote refid st t when poll reach delay offset jitter \============================================================================== 10 250 0 240 203 107 6 88 3 u 46 64 377 0 165 10 575 3 198 show ntp server show ntp server \[command] show ntp server \[purpose] display configuration of ntp server \[view] privileged user view \[use cases] sonic# show ntp server server state type key \ 10 250 0 242 enabled server 10 250 0 243 enabled server show ntp global show ntp global \[command] show ntp global \[purpose] display global configuration of ntp \[view] privileged user view \[use cases] sonic# show ntp global state enabled authentication disabled vrf default show ntp authentication keyid show ntp authentication keyid \[command] show ntp global \[purpose] display ntp authentication key \[view] privileged user view \[use cases] sonic# show ntp authentication keyid key id type trusted \ 1 md5 yes ntp config ntp config table 4 ntp config table 4 ntp config true 317,289#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type ntp enable ntp enable \[command] ntp enable \[purpose] enable ntp automatic synchronization service \[view] global configuration view \[notes] run command no ntp enable to disable ntp \[use cases] sonic(config)# ntp enable ntp server ntp server server ip \[ authentication keyid ] \[command] ntp server server ip \[ authentication keyid ] \[purpose] specify a ntp server \[parameters] true 410,196#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type \[view] global configuration view \[notes] run command no ntp server server ip to delete ntp server configuration \[use cases] sonic(config)# ntp server 10 250 0 242 ntp source interface {mgmt|loopback|ethernet|link aggregation|vlan} ntp source interface {mgmt|loopback|ethernet|link aggregation|vlan} interface name \[command] ntp source interface { mgmt|loopback|ethernet|link aggregation|vlan } interface name \[purpose] specify the source interface for ntp \[parameters] true 146,460#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type \[view] global configuration view \[notes] run command no ntp source interface to delete ntp source interface configuration \[use cases] sonic(config)# ntp source interface mgmt 0 sonic(config)# ntp source interface loopback 0 ntp synchronize \[unprivileged] ntp synchronize \[unprivileged] server ip \[command] ntp synchronize \[ unprivileged ] server ip \[purpose] synchronise manually from an ntp server \[parameters] true 117,489#4283c7 unhandled content type #4283c7 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type \[view] global configuration view \[notes] when you run this command, the system will immediately synchronise to ntp server time this command is valid for a single time and will not be saved to running config \[use cases] sonic(config)# ntp synchronize unprivileged 10 250 0 243 18 nov 20 10 52 ntpdate\[385097] adjust time server 10 250 0 243 offset 0 009762 sec ntp synchronize jump ntp synchronize jump \[command] ntp synchronize jump \[purpose] enable ntp jump synchronization \[view] global configuration view \[notes] with this command set, the system will make a time adjustment with a large offset every time the process restarts by default a jump synchronization will be made only when the offset is over 600 seconds \[use cases] sonic(config)# ntp synchronize jump ntp vrf {default|mgmt} ntp vrf {default|mgmt} \[command] ntp vrf { default|mgmt } \[purpose] specify the vrf where the ntp source interface is located \[view] global configuration view \[notes] when you have set the management port as ntp source interface as and enabled management vrf, please specify mgmt as ntp vrf by default, the ntp vrf is default vrf \[use cases] sonic(config)# ntp vrf default sonic(config)# ntp vrf mgmt ntp authentication enable ntp authentication enable \[command] ntp authentication enable \[purpose] enable ntp authentication \[view] global configuration view \[notes] run command no ntp authentication enable to disable ntp authentication \[use cases] sonic(config)# ntp authentication enable ntp authentication keyid ntp authentication keyid key id {md5|sha1|sha256|sha384|sha512} \[command] ntp authentication keyid key id {md5|sha1|sha256|sha384|sha512} \[purpose] add ntp key \[view] global configuration view \[notes] run command no ntp authentication keyid key id to delete ntp key \[use cases] sonic(config)# ntp authentication keyid 1 md5 please enter authentication key value sonic(config)#
