Would you like to learn how to set date and time using NTP on a Cisco Switch using the command-line? In this tutorial, we are going to show you all the steps required to configure date and time using NTP a Cisco Switch 2960 or 3750 using the command-line.
Tutorial - Configure NTP on Cisco Switch
First, you need to access the console of your Cisco Switch.
In our example, we are going to use an Opensource software named Putty and a computer running Windows.
The Putty software is available on the putty.org website.
After finishing the download, run the software and wait for the following screen.
To access the console of a Cisco Switch model 2960 or 3750, you will need to select the Serial Connection category and use the following options:
• Connection type: Serial
• Serial line: COM1
• Speed: 9600
If COM1 does not work you will need to try to use COM2, COM3, COM4 or the next.
Using either the console, telnet or ssh, connect to the command-line of your switch and log in with a user who has administrative privileges.
On the prompt screen, enter the administrative login information.
After a successful login, the console command-line will be displayed.
Use the enable command to enter the privilege mode.
Use the configure terminal command to enter the configuration mode.
Switch# configure terminal
Configure NTP and the correct Timezone using the following commands:
Switch(config)# ntp server 126.96.36.199
Switch(config)# clock timezone BR -3 0
In our example, the timezone code BR was used to represent the Brazilian time.
In our example, the timezone GMT -3 was used to represent the Brazilian time.
In our example, the NTP server 188.8.131.52 is providing the correct time.
Use the following command to verify your configuration.
Switch# show ntp associations
Switch# show clock
Don't forget to save your switch configuration.
Switch# copy running-config startup-config
You have successfully configured NTP on Cisco Switch.