SONiC de DELL Networking Cómo configurar manualmente la fecha, la hora, el reloj y la zona horaria

Summary: En este artículo, se explica cómo configurar manualmente la fecha, la hora, el reloj y la zona horaria en Dell SONiC.

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Instructions

Puntos para recordar 

  • Este procedimiento requiere que el usuario tenga una función de administrador para acceder al shell de Linux.
  • La mejor práctica es configurar el reloj mediante un servidor NTP en todos los dispositivos de la red cuando hay un servidor NTP disponible.

 

Pasos

Verifique el estado de RTC y NTP.
Deshabilite el reloj en tiempo real y el protocolo de tiempo de red si están activados.
Configurar fecha y hora.
Cómo configurar la zona horaria
 

Verifique el estado de RTC y NTP.

Utilice el siguiente comando para verificar el estado de RTC y NTP.

Sintaxis
del comandoDesde el shell de Linux

admin@DELLSONiC:~$ sudo timedatectl status

Ejemplo de salida

admin@DELLSONiC:~$ sudo timedatectl status
               Local time: Tue 2023-10-03 04:01:58 UTC
           Universal time: Tue 2023-10-03 04:01:58 UTC
                 RTC time: Tue 2023-10-03 04:01:59
                Time zone: UTC (UTC, +0000)
System clock synchronized: no
              NTP service: inactive
          RTC in local TZ: Yes
admin@sonic:~$ 


O

sintaxis
de comandos desde la CLI de Dell Management Framework

admin@DELLSONiC:~$ sonic-cli
DELLSONiC# show clock

Ejemplo de salida

DELLSONiC# show clock 
Tue 03 Oct 2023 04:02:28 AM UTC

 

Deshabilite el reloj en tiempo real y el protocolo de tiempo de red si están activados. 

Se recomienda que el RTC permanezca apagado para que el reloj en tiempo real utilice UTC y no sea local para evitar problemas de zona horaria o cambio de horario de verano. NTP está apagado para asegurarse de que NTP no esté sincronizado cuando desee configurar manualmente la hora en el switch. 

Utilice el siguiente comando en el shell de Linux para deshabilitar reloj en tiempo real y NTP. 

Sintaxis del comando

admin@DELLSONiC:~$ sudo timedatectl set-local-rtc false
admin@DELLSONiC:~$ sudo timedatectl set-ntp false

Ejemplo de salida

Verify

admin@DELLSONiC:~$ sudo timedatectl status
               Local time: Tue 2023-10-03 04:01:58 UTC
           Universal time: Tue 2023-10-03 04:01:58 UTC
                 RTC time: Tue 2023-10-03 04:01:59
                Time zone: UTC (UTC, +0000)
System clock synchronized: no
              NTP service: inactive
          RTC in local TZ: No
admin@sonic:~$ 

 

Configurar fecha y hora.

Sintaxis del comando

admin@DELLSONiC:~$ sudo timedatectl set-time YYYY-MM-DD HH:MM:SS

YYYY-MM-DD is Year- Month-Day
HH:MM:SS   is Hour:Minute:Seconds

Ejemplo de configuración
Tenga en cuenta que la FECHA se establece como 2023-12-30 y hora 12:30:50.

admin@DELLSONiC:~$ sudo timedatectl set-time '2023-12-30 12:30:50'

Ejemplo de salida

Verify

admin@DELLSONiC:~$ sudo timedatectl status
               Local time: Sat 2023-12-30 07:31:52 EST
           Universal time: Sat 2023-12-30 12:31:52 UTC
                 RTC time: Sat 2023-12-30 12:31:53
                Time zone: Etc/UTC (UTC, +0000)
System clock synchronized: no
              NTP service: inactive
          RTC in local TZ: no
admin@DELLSONiC:~$ 

 

Cómo configurar la zona horaria

Sintaxis del comando

admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure
DELLSONiC(config)# clock timezone 

Hint: use ? to find out the available options

Ejemplo de salida (salida trimada para Brevity)

ELLSONiC(config)# clock timezone ?
  Africa/             Africa timezones
  America/            America timezones
  Antarctica/         Antarctica timezones
  Arctic/             Arctic timezones
  Asia/               Asia timezones
  Atlantic/           Atlantic timezones
  Australia/          Australia timezones
  Brazil/             Brazil timezones
  Canada/             Canada timezones
  CET                 CET timezone
  Chile/              Chile timezones

Configuración de muestra

admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure
DELLSONiC(config)# clock timezone America/New_York 

Ejemplo de salida

Verify

admin@DELLSONiC:~$ sudo timedatectl status
               Local time: Sat 2023-12-30 07:34:29 EST
           Universal time: Sat 2023-12-30 12:34:29 UTC
                 RTC time: Sat 2023-12-30 12:34:29
                Time zone: America/New_York (EST, -0500)
System clock synchronized: no
              NTP service: inactive
          RTC in local TZ: no
admin@DELLSONiC:~$ 

Affected Products

Enterprise SONiC Distribution, PowerSwitch S6000 ON, PowerSwitch E3200-ON Series, Dell EMC Networking N3200-ON, PowerSwitch S5212F-ON, PowerSwitch S5224F-ON, PowerSwitch S5232F-ON, PowerSwitch S5248F-ON, PowerSwitch S5296F-ON, PowerSwitch S6100-ON , PowerSwitch Z9100-ON, PowerSwitch Z9264F-ON, PowerSwitch Z9332F-ON ...
Article Properties
Article Number: 000218204
Article Type: How To
Last Modified: 14 Oct 2023
Version:  3
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.