DELL Networking SONiC Anleitung zum manuellen Einstellen von Datum, Uhrzeit, Uhr und Zeitzone

Summary: In diesem Artikel wird erläutert, wie Sie Datum, Uhrzeit, Uhr und Zeitzone manuell in Dell SONiC einstellen.

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

Merkpunkte 

  • Dieses Verfahren erfordert, dass der Benutzer über eine Administratorrolle für den Zugriff auf Linux Shell verfügt.
  • Die Best Practice besteht darin, die Uhr mithilfe eines NTP-Servers in allen Geräten im Netzwerk zu konfigurieren, wenn ein NTP-Server verfügbar ist.

 

Schritte

Überprüfen Sie den RTC- und NTP-Status.
Deaktivieren Sie die Echtzeituhr und das Netzwerkzeitprotokoll, wenn sie aktiviert sind.
Datum und Uhrzeit konfigurieren.
Festlegen der Zeitzone
 

Überprüfen Sie den RTC- und NTP-Status.

Verwenden Sie den folgenden Befehl, um den RTC- und NTP-Status zu überprüfen.

Befehlssyntax
Über Linux Shell

admin@DELLSONiC:~$ sudo timedatectl status

Beispielausgabe

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:~$ 


oderBefehlssyntax


über die CLI des Dell Management Framework

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

Beispielausgabe

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

 

Deaktivieren Sie die Echtzeituhr und das Netzwerkzeitprotokoll, wenn sie aktiviert sind. 

RtC wird empfohlen, ausgeschaltet zu bleiben, damit die Echtzeituhr UTC und nicht lokal verwendet, um Zeitzonen- oder Sommerzeitprobleme zu vermeiden. NTP ist ausgeschaltet, um sicherzustellen, dass NTP nicht synchronisiert ist, wenn Sie die Zeit auf dem Switch manuell einstellen möchten. 

Verwenden Sie den folgenden Befehl in der Linux-Shell, um Die Echtzeituhr und NTP zu deaktivieren. 

Befehlssyntax

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

Beispielausgabe

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:~$ 

 

Datum und Uhrzeit konfigurieren.

Befehlssyntax

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

Beispielkonfiguration
Beachten Sie, dass das DATUM auf 2023-12-30 und die Uhrzeit 12:30:50 eingestellt ist.

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

Beispielausgabe

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:~$ 

 

Festlegen der Zeitzone

Befehlssyntax

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

Hint: use ? to find out the available options

Beispielausgabe (Ausgabe für Brevity getrimmt)

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

Beispielkonfiguration

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

Beispielausgabe

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.