DELL Networking SONiC Sådan indstiller du dato, klokkeslæt, ur og tidszone manuelt

Shrnutí: Denne artikel forklarer, hvordan du indstiller dato, klokkeslæt, ur og tidszone manuelt i Dell SONiC.

Tento článek se vztahuje na Tento článek se nevztahuje na Tento článek není vázán na žádný konkrétní produkt. V tomto článku nejsou uvedeny všechny verze produktu.

Pokyny

Vigtigt at huske 

  • Denne procedure kræver, at brugeren har en administratorrolle for at få adgang til Linux Shell.
  • Den bedste fremgangsmåde er at konfigurere uret ved hjælp af en NTP-server i alle enheder på netværket, når en NTP-server er tilgængelig.

 

Trin

Verificer RTC- og NTP-status.
Deaktiver realtidsuret og netværkstidsprotokollen, hvis de er aktiveret.
Konfigurer dato og klokkeslæt.
Sådan indstilles tidszonen
 

Verificer RTC- og NTP-status.

Brug følgende kommando til at kontrollere RTC- og NTP-status.

Kommandosyntaks
Fra Linux Shell

admin@DELLSONiC:~$ sudo timedatectl status

Eksempel på output

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


Eller

kommandosyntaks
fra DELL Management Framework CLI

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

Eksempel på output

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

 

Deaktiver realtidsuret og netværkstidsprotokollen, hvis de er aktiveret. 

RTC anbefales at forblive slukket, så realtidsuret bruger UTC og ikke lokalt for at undgå problemer med tidszone eller sommertid. NTP er deaktiveret for at sikre, at NTP ikke synkroniseres, når du ønsker at indstille klokkeslættet på switchen manuelt. 

Brug følgende kommando i Linux-shell'en til at deaktivere realtidsur og NTP. 

Kommandosyntaks

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

Eksempel på output

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

 

Konfigurer dato og klokkeslæt.

Kommandosyntaks

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

Eksempelkonfiguration
Overvej, at DATOEN er indstillet til 2023-12-30 og klokkeslæt 12:30:50.

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

Eksempel på output

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

 

Sådan indstilles tidszonen

Kommandosyntaks

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

Hint: use ? to find out the available options

Prøveoutput (output er optimeret til korthed)

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

Eksempelkonfiguration

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

Eksempel på output

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

Dotčené produkty

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 ...
Vlastnosti článku
Číslo článku: 000218204
Typ článku: How To
Poslední úprava: 14 říj 2023
Verze:  3
Najděte odpovědi na své otázky od ostatních uživatelů společnosti Dell
Služby podpory
Zkontrolujte, zda se na vaše zařízení vztahují služby podpory.