DELL Networking SONiC Handmatig datum, tijd, klok en tijdzone instellen

Shrnutí: In dit artikel wordt uitgelegd hoe u handmatig datum, tijd, klok en tijdzone instelt in 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

Punten om te onthouden 

  • Voor deze procedure moet de gebruiker een beheerdersrol hebben om toegang te krijgen tot Linux Shell.
  • De aanbevolen werkwijze is om de klok te configureren met behulp van een NTP-server in alle apparaten in het netwerk wanneer een NTP-server beschikbaar is.

 

Stappen

Controleer de RTC- en NTP-status.
Schakel het Real-Time Clock and Network Time Protocol uit als deze zijn geactiveerd.
Datum en tijd configureren.
Tijdzone instellen
 

Controleer de RTC- en NTP-status.

Gebruik de volgende opdracht om de RTC- en NTP-status te verifiëren.

Opdrachtsyntaxis
Vanuit Linux Shell

admin@DELLSONiC:~$ sudo timedatectl status

Uitvoervoorbeeld

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


Of

opdrachtsyntaxis
vanuit de DELL Management Framework CLI

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

Uitvoervoorbeeld

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

 

Schakel het Real-Time Clock and Network Time Protocol uit als deze zijn geactiveerd. 

RTC wordt aanbevolen om uit te blijven, zodat de realtime klok UTC gebruikt en niet lokaal om problemen met de tijdzone of zomertijd te voorkomen. NTP is uitgeschakeld om ervoor te zorgen dat NTP niet wordt gesynchroniseerd wanneer u handmatig tijd op de switch wilt instellen. 

Gebruik de volgende opdracht in de Linux-shell om real-time klok en NTP uit te schakelen. 

Opdrachtsyntaxis

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

Uitvoervoorbeeld

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 en tijd configureren.

Opdrachtsyntaxis

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

Voorbeeldconfiguratie
Houd er rekening mee dat de DATUM is ingesteld op 2023-12-30 en tijd 12:30:50.

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

Uitvoervoorbeeld

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

 

Tijdzone instellen

Opdrachtsyntaxis

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

Hint: use ? to find out the available options

Uitvoervoorbeeld (uitvoer getrimd voor 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

Voorbeeldconfiguratie

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

Uitvoervoorbeeld

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.