To configure clocks and timestamps on a Cisco router or switch, set the system clock (manually or via NTP) and enable timestamp formatting for logs and debugs.
1. Set Time Zone (Optional):
Configure your local time zone in global configuration mode (for example, BST at +06:00 for Bangladesh):
enable
configure terminal
clock timezone BST 62. Set the System Clock
• Via NTP (Recommended): Synchronize automatically with an NTP server:
configure terminal
ntp server <NTP-SERVER-IP-OR-DOMAIN>• Manually: Run in privileged EXEC mode (time may reset on reboot without NTP or a hardware calendar):
enable
clock set hh:mm:ss Month Day YearExample: clock set 09:17:00 June 04 2026
3. Enable Timestamps for Logs and Debugs
Add local date, time, time zone, and milliseconds to syslog and debug messages:
configure terminal
service timestamps log datetime localtime show-timezone msec
service timestamps debug datetime localtime show-timezone msec4. Verify Configuration
Run these commands in privileged EXEC mode to check your clock and NTP sync status:
show clock
show clock detail
show ntp status
No comments:
New comments are not allowed.