System time configuration is of great importance in a network. Synchronized system clocks provide a frame of reference between all devices on the network. Network time synchronization is critical because every aspect of managing, securing, planning, and debugging a network involves determining when events occur. Without synchronized clocks, accurately correlating log files between devices when tracking security breaches or network usage is impossible.
Synchronized time also reduces confusion in shared file systems, as it is important for the modification times to be consistent, regardless of the machine on which the file systems reside. The Cisco Business Switches support Simple Network Time Protocol (SNTP), and when enabled, the switch dynamically synchronizes the device time with time from an SNTP server.
You can manage the system time and date settings on your switch using automatic configuration, such as the SNTP, or manual configuration methods. The switch operates only as an SNTP client, and cannot provide time services to other devices.
This article provides instructions on how to configure the system time settings on your switch through the Command Line Interface (CLI).
Note: To configure the system time settings on your switch through the web-based utility, click here.
By default, there is no configured network policy on the switch. The default LLDP-MED global and interface settings are the following:
Feature |
Default Setting |
Clock Source |
SNTP |
Time from Browser |
Disabled |
Time Zone (Static) |
Offset is UTC+0 |
DHCP Time zone |
Disabled |
Summer Time (DST) |
Disabled |
Step 1. Log in to the switch console. The default username and password is cisco/cisco. If you have configured a new username or password, enter the credentials instead.
Note: The commands may vary depending on the exact model of your switch. In this example, the CBS350 switch is accessed through Telnet.
Step 2. To display the current configuration settings of the port or ports that you want to configure, enter the following:
CBS350#show clock [detail]The following information are displayed:
Step 3. Choose your preferred system time configuration:
Step 1. In the Privileged EXEC mode of the switch, enter the Global Configuration context by entering the following:
CBS350#configure terminalStep 2. To configure an external time source, enter the following:
CBS350(config)#clock source [sntp|browser]The options are:
Note: In this example, sntp is configured as the main clock source and the browser as the alternate clock source.
Step 3. (Optional) To display the configured system time settings, enter the following:
CBS350#show clock detailStep 4. (Optional) In the Privileged EXEC mode of the switch, save the configured settings to the startup configuration file, by entering the following:
CBS350#copy running-config startup-configStep 5. (Optional) Press Y for Yes or N for No on your keyboard once the Overwrite file [startup-config]… prompt appears.
You should now have automatically configured the system time settings on your switch through the CLI.
If no other source of time is available, you can manually configure the time and date after the system is restarted. The time remains accurate until the next system restart. It is recommended that you use manual configuration only as a last resort. If you have an outside source to which the switch can synchronize, you do not need to manually set the system clock.
Important: If you have an outside source on the network that provides time services such as an SNTP server, you do not need to manually set the system clock.
To manually configure the system time settings on your switch, follow these steps:
Step 1. In the Privileged EXEC mode of the switch, enter the following:
CBS350#clock set [hh:mm:ss] [month] [day] [year]The options are:
- hh - 0 to 23
- mm - 0 to 59
- ss - 0 to 59
Note: After reboot, the system clock is set to the time of the image creation. In this example, the clock time is set to 12:15:30 with the clock date of May 12, 2017.
Step 2. In the Privileged EXEC mode of the switch, enter the Global Configuration context by entering the following:
CBS350#configure terminalStep 3. To disable the SNTP as the time source for the system clock, enter the following:
CBS350(config)#no clock source sntpStep 4. (Optional) To set the time zone for display purposes, enter the following:
CBS350(config)#clock timezone [zone] [hours-offset] [minutes-offset]The options are:
Note: The system internally keeps time in UTC, so this command is used only for display purposes and when the time is manually set.
CBS350(config)#clock timezone PST -8Step 5. (Optional) To restore the default time zone configuration settings, enter the following:
CBS350(config)#no clock timezoneStep 6. (Optional) To specify that the time zone and the Summer Time (DST) of the system can be taken from the DHCP time zone option, enter the following:
CBS350(config)#clock dhcp timezoneUpon configuring the DHCP time zone, check the following guidelines:
- The information received from DHCPv6 precedes information received from DHCPv4
- The information received from DHCP client running on lower interface precedes information received from DHCP client running on higher interface
Step 7. (Optional) To restore the default DHCP time zone configuration, enter the following:
CBS350(config)#no clock dhcp timezoneStep 8. (Optional) To configure the system to automatically switch to Summer Time (DST), enter one of following:
CBS350(config)#clock summer-time [zone] recurring {usa | eu | {week day hh:mm week day hh:mm}} [offset] CBS350(config)#clock summer-time zone recurring {usa | eu | {[day month year hh:mm] [day month year hh:mm]}} [offset] CBS350(config)#clock summer-time [zone] date [month day year hh:mm] [month day year hh:mm] [offset]The options are:
- Start - Second Sunday in March
- End - First Sunday in November
- Time 2 a.m. local time
- Start - Last Sunday in March
- End - Last Sunday in October
- Time 1 a.m. local time
- hh - 0 to 23
- mm - 0 to 59
- ss - 0 to 59
Note: In this example, a recurring DST is configured with PST time zone. It starts every 00:00 on the first Sunday of March, and ends every second Sunday of November. The offset time is 60 minutes.
Step 9. Enter the exit command to go back to the Privileged EXEC mode:
CBS350#exitStep 10. (Optional) To display the configured system time settings, enter the following:
CBS350#show clock detailStep 11. (Optional) In the Privileged EXEC mode of the switch, save the configured settings to the startup configuration file, by entering the following:
CBS350#copy running-config startup-configStep 12. (Optional) Press Y for Yes or N for No on your keyboard once the Overwrite file [startup-config]… prompt appears.
You have now successfully manually configured the system time settings on your switch through the CLI.