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
- If the NTP server requires authentication, define the authentication key for the NTP client with the command
ntp authentication
. - 配置一个国家结核控制规划服务器的命令
ntp server
. - 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
. - Review your NTP configuration settings with the commands
show ntp servers
andshow ntp status
. - See the current switch time, date, and time zone with the command
show 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