Setting switch time using the NTP client


  • The IP address or domain name of an NTP server.
  • If the NTP server uses authentication, obtain the password required to communicate with the NTP server.


  1. If the NTP server requires authentication, define the authentication key for the NTP client with the command ntp authentication.
  2. Configure an NTP server with the command ntp server. When configuring a time backward more than five minutes, a reboot is recommended to avoid unusual switch behavior.
  3. By default, NTP traffic is sent on the default VRF. If you want to send NTP traffic on the management VRF, use the command ntp vrf.
  4. Review your NTP configuration settings with the commands show ntp servers and show ntp status.
  5. See the current switch time, date, and time zone with the command show clock.


This example creates the following configuration:

  • Defines the authentication key 1 with the password myPassword.
  • Defines the NTP server and makes it the preferred server.
  • Sets the switch to use the management VRF (mgmt) for all NTP traffic.

switch(config)# ntp authentication-key 1 md5 myPassword

switch(config)# ntp server key 10 prefer

switch(config)# ntp vrf mgmt