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.
Pokyny
Punten om te onthouden
|
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:~$ |