Time Configuration
24 min
\<font color="#1d50a2">time\</font> \<font color="#1d50a2">time view\</font> \<font color="#1d05a2">table 1 time view\</font> command purpose show clock display the time zone and time of the system show supported timezones display the time zones the system supports \<font color="#1d50a2">show clock\</font> \[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 \<font color="#1d50a2">show supported timezones\</font> \[command] show supported timezones \[purpose] display the time zones the system supports \[view] privileged user view \[use cases] sonic# show supported timezones \<font color="#1d50a2">time config\</font> \<font color="#1d05a2">table 2 time config\</font> command purpose clock datetime date time set the system time clock timezone zone set the system time zone \<font color="#1d50a2">clock datetime \</font> \[command] clock datetime date time \[purpose] set the system time \[parameters] parameter description date in yy mm dd format time in hh\ mm\ ss format \[view] global configuration view \[use cases] sonic# configure sonic(config)# clock datetime 2022 02 22 20 30 30 \<font color="#1d50a2">clock timezone \</font> \[command] clock timezone zone \[purpose] set the system time zone \[parameters] parameter description zone the default time zone is utc \[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 \<font color="#1d50a2">ntp\</font> ntp(network time protocol)is a protocol used to synchronize the time of individual machines on a network \<font color="#1d50a2">ntp view\</font> \<font color="#1d05a2">table 3 ntp view\</font> command purpose show ntp display ntp status show ntp server display configuration of ntp server show ntp global display global configuration of ntp show ntp authentication keyid display ntp authentication key \<font color="#1d50a2">show ntp\</font> \[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 \<font color="#1d50a2">show ntp server\</font> \[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 \<font color="#1d50a2">show ntp global\</font> \[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 \<font color="#1d50a2">show ntp authentication keyid\</font> \[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 \<font color="#1d50a2">ntp config\</font> \<font color="#1d05a2">table 4 ntp config\</font> command purpose ntp enable enable ntp automatic synchronization service ntp server server ip \[ authentication keyid ] specify a ntp server ntp source interface {mgmt|loopback|ethernet|link aggregation|vlan} interface name specify the source interface for ntp ntp synchronize \[unprivileged] server ip synchronise manually from an ntp server ntp synchronize jump enable ntp jump synchronization ntp vrf {default|mgmt} specify the vrf where the ntp source interface is located ntp authentication enable enable ntp authentication ntp authentication keyid key id {md5|sha1|sha256|sha384|sha512} add ntp key \<font color="#1d50a2">ntp enable\</font> \[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 \<font color="#1d50a2">ntp server \</font> \[command] ntp server server ip \[ authentication keyid ] \[purpose] specify a ntp server \[parameters] parameter description server ip |ntp server ip address or domain name authentication keyid | \[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 \<font color="#1d50a2">ntp source interface {mgmt|loopback|ethernet|link aggregation|vlan} \</font> \[command] ntp source interface { mgmt|loopback|ethernet|link aggregation|vlan } interface name \[purpose] specify the source interface for ntp \[parameters] parameter description interface name interface name (eg 0/1) when specify mgmt the interface name is 0 \[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 \<font color="#1d50a2">ntp synchronize \[unprivileged] \</font> \[command] ntp synchronize \[ unprivileged ] server ip \[purpose] synchronise manually from an ntp server \[parameters] parameter description unprivileged this parameter should be enabled when the ntp auto sync service is already running so that manual synchronisation can be performed over an unprivileged port server ip specify ntp server ip address \[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 \<font color="#1d50a2">ntp synchronize jump\</font> \[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 \<font color="#1d50a2">ntp vrf {default|mgmt}\</font> \[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 \<font color="#1d50a2">ntp authentication enable\</font> \[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 \<font color="#1d50a2">ntp authentication keyid \</font> \[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)#
