Table Of Contents
Configuring Network Time Protocol
About NTP
Configuring NTP
Configuring Network Time Protocol
This chapter describes how to configure the Network Time Protocol (NTP) on the Catalyst 4840G SLB switch. For further information about the commands used in this chapter, refer to the command reference publications in the Cisco IOS documentation set and to "Command Reference."
This chapter includes the following sections:
•
About NTP
•
Configuring NTP
About NTP
NTP is a utility for synchronizing system clocks over the network, providing a precise time base for networked workstations and servers. In NTP model, a hierarchy of primary and secondary servers pass timekeeping information over the Internet to cross-check clocks and correct errors arising from equipment or propagation failures.
An NTP server must be accessible by the client switch and is documented in RFC 1305. All NTP communication uses Coordinated Universal Time (UTC), which is the same as Greenwich Mean Time. An NTP network usually gets its time from an authoritative time source, such as a radio clock or an atomic clock attached to a time server. NTP distributes this time across the network. NTP is extremely efficient; no more than one packet per minute is necessary to synchronize two machines to within a millisecond of one another.
NTP uses a stratum to describe how many NTP hops away a machine is from an authoritative time source. A stratum 1 time server has a radio or atomic clock directly attached, a stratum 2 time server receives its time from a stratum 1 time server, and so on. A machine running NTP automatically chooses as its time source the machine with the lowest stratum number that it is configured to communicate with through NTP. This strategy effectively builds a self-organizing tree of NTP speakers.
NTP has two ways to avoid synchronizing to a machine whose time might be ambiguous:
•
NTP never synchronizes to a machine that is not synchronized itself.
•
NTP compares the time reported by several machines and does not synchronize to a machine whose time is significantly different from the others, even if its stratum is lower.
The communications between machines running NTP, known as associations, are usually statically configured; each machine is given the IP address of all machines with which it should form associations. Accurate timekeeping is possible by exchanging NTP messages between each pair of machines with an association. However, in a LAN environment, you can configure NTP to use IP broadcast messages. With this alternative, you can configure the machine to send or receive broadcast messages, but the accuracy of timekeeping is marginally reduced because the information flow is one-way only.
The Cisco implementation of NTP does not support stratum 1 service; it is not possible to connect to a radio or atomic clock. We recommend that you obtain the time service for your network from the public NTP servers available in the IP Internet. If the network is isolated from the Internet, the Cisco NTP implementation allows a machine to be configured so that it acts as though it is synchronized using NTP, when in fact it has determined the time using other means. Other machines then synchronize to that machine using NTP.
A number of manufacturers include NTP software for their host systems, and a version for systems running UNIX and its various derivatives is also publicly available. This software allows host systems to be time-synchronized as well.
Configuring NTP
NTP services are enabled on all interfaces by default. You can configure the Catalyst 4840G SLB switch in either of the following NTP associations:
•
Peer association—This system either synchronizes to the other system or allows the other system to synchronize to it.
•
Server association—This system synchronizes to the other system, and not the other way around.
To configure NTP, perform this task from global configuration mode:
| |
Command
|
Purpose
|
Step 1
|
SLB-Switch(config)# ntp
update-calendar
|
Update hardware calendar with NTP time.
|
Step 2
|
SLB-Switch(config)# ntp server
ip-address
|
Form a server association with another system. You can specify multiple associations.
|
Step 3
|
|
Return to privileged EXEC mode.
|
Step 4
|
SLB-Switch# copy
system:running-config
nvram:startup-config
|
Save your configuration changes to NVRAM.
|
This example shows how to configure NTP to set the hardware calendar and set the NTP server IP addresses:
SLB-Switch(config)# ntp update-calendar
SLB-Switch(config)# ntp server 171.71.150.52
SLB-Switch(config)# ntp server 171.69.4.143
SLB-Switch(config)# ntp server 171.69.5.10
SLB-Switch# copy system:running-config nvram:startup-config
Destination filename [startup-config]?
Building configuration...
To view the current NTP configuration and status, enter the show ntp status or the show ntp associations commands.
For a complete configuration example that includes NTP, see the "Example ISL VLAN and BVI with GEC Configuration" section.