Setting switch time using the NTP client

Prerequisites
  • 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.
Procedure
  1. If the NTP server requires authentication, define the authentication key for the NTP client with the commandntp authentication.
  2. 配置一个国家结核控制规划服务器的命令ntp server.
  3. By default, NTP traffic is sent on the default VRF. If you want to send NTP traffic on the management VRF, use the commandntp vrf.
  4. Review your NTP configuration settings with the commandsshow ntp serversandshow ntp status.
  5. See the current switch time, date, and time zone with the commandshow clock.

Example

This example creates the following configuration:

  • Defines the authentication key1with the passwordmyPassword.
  • Defines the NTP servermy-ntp.mydomain.comand 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 myPasswordswitch(config)#ntp server my-ntp.mydomain.com key 10 preferswitch(config)#ntp vrf mgmt