From a logging point of view, it's interesting to have your clock set up correctly on your Cisco switches. Your switch should have these capabilities, but network admins usually "forget" to set these up.
To configure these, you need to have privileged access to your switch using SSH/telnet/console. The following works on any device running iOS (i.e. switches and routers).
Time zones are expressed as a name, followed by an offset. The offset indicates the number of hours from UTC, expressed as -hour or +hour. To know the offset for your time zone, you could look at the World Time Zone map.
In my case, for Central European Time, I would set it to this:
SW(config)# clock timezone CET +1
For Central Standard Time:
SW(config)# clock timezone CST -6
Note that "CET" and "CST" are arbitrary names, although it's recommended to stick to the standards.
Your switch is also capable of automatically updating its clock for DST. This can be done manually, or recurringly (using US rules for enabling and disabling in April, resp. October).
For Central European Time, this becomes like so:
SW(config)# clock summer-time CEST recurring
For Central Daylight Time:
SW(config)# clock summer-time CDT recurring
Setting this to recurring automatically enables/disables DST, depending on the current date (of your switch). DST follows US rules for enabling/disabling DST (April and October).
First of, I strongly recommend using an NTP server as a time source, as it's more reliable and it keeps the internal clock from drifting. Moreover, if your switch gets power cycled, it will resync with the NTP server, so you don't have to set the clock again.
If you really want to, you can manually set the clock like so:
SW# clock set hh:mm:ss MMM DD YYYY
There are some rules to follow:
Setting up clock and timezone is one thing, but it's even better to have your switches sync to an NTP server so the date and time is always right.
Setting up your switch to use an NTP server is very easy:
SW(config)# ntp server ip-address
This enables the internal NTP client and starts synchronization with the NTP server as a time source.
To check the status of the clock and NTP sync, you can use these commands:
SW# show clock detail
This shows the current clock and whether it's set up manually or set up using an NTP server.
SW# show ntp status
This reveals the current NTP peer status, which stratum the NTP server is, what the clock offset is, and so on.
« ‹ | November 2024 | › » | ||||
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |