ntp

To configure the Network Time Protocol (NTP) peers and servers for the switch, use the ntp command. To remove configured peers and servers, use the no form of this command.

ntp { peer hostname | server hostname } [ prefer ] [ use-vrf vrf-name ]

no ntp { peer hostname | server hostname }

Syntax Description

peer hostname
Specifies the hostname or IP address of an NTP peer.
server hostname
Specifies the hostname or IP address of the NTP server.
prefer
(Optional) Specifies this peer/server as the preferred peer/server.
use-vrf vrf-name
(Optional) Specifies the virtual routing and forwarding (VRF) used to reach this peer/server.

Command Default

None

Command Modes

Global configuration mode

Command History

Release
Modification
4.0(0)N1(1a)
This command was introduced.
4.0(1a)N1(1)
The keyword use-vrf replaces the keyword vrf . The keyword vrf is retained for backwards compatibility.

Usage Guidelines

You can specify multiple peer associations.

Examples

This example shows how to form a server association with a server:

switch(config)# ntp server ntp.cisco.com
 

This example shows how to form a peer association with a peer:

switch(config)# ntp peer 192.168.10.0
 

This example shows how to delete an association with a peer:

switch(config)# no ntp peer 192.168.10.0
 

Related Commands

Command
Description
ntp distribute
Enables CFS distribution for NTP.
show ntp
Displays NTP information.