Network Time Protocol

Overview

Each Cisco switch has an internal time clock that runs continuously without any intervention. It is useful when you look at the log and compare different events happening time. However, do not assume that a switch already has its internal clock set to the correct date and time. This section will describe how to synchronize switch clock using NTP.

Showing the Switch Clock

Switch# show clock
*00:54:09.691 UTC Mon Mar 1 1993

Setting the Clock Manually

Switch(config)# clock timezone name offset-hours [ offset-minutes ]
Switch(config)# clock summer-time name date start-month date year hh:mm end-month day year hh:mm [ offset-minutes ]
Switch(config)# clock summer-time name recurring [ start-week day month hh:mm end-week day month hh:mm [ offset-minutes ]
Switch(config)# exit
Switch# clock set hh:mm:ss

Example

Switch(config)# clock timezone EST -5
Switch(config)# clock summer-time EDT recurring
Switch(config)# exit
Switch# clock set 15:23:00

Stratum

With NTP, time sources or servers are arranged in a hierarchical fashion, with each layer of time servers synchronizing with other servers in a higher layer. Each layer of the hierarchy is known as a stratum , where the stratum number indicates the number of NTP “hops” needed to reach the top. You can think of stratum 0 as the actual time. Authoritative time servers are located in stratum 1. NTP servers that synchronize with stratum 1 servers are designated as stratum 2. The NTP stratums keep incrementing up to 255 toward the servers that client devices use for their synchronization.

A device can work at one of the following NTP modes.

  • Server - The device synchronizes with a source in a lower stratum and provides time synchronization with servers or clients in a higher stratum.
  • Client - The device synchronizes its clock with an NTP server.
  • Peer - The device exchanges time information with another peer device.
  • Broadcast/multicast - The device operates as an NTP server, but pushes time information out to any listening device. Because the “push” is in only one direction, the time accuracy can suffer somewhat.

Association Modes

The following sections describe the associating modes used by NTP servers to associate with each other.

  • Client/Server
  • Symmetric Active/Passive
  • Broadcast

Client/Server Mode

Servers that provide synchronization to a sizeable population of clients normally operate as a group of three or more mutually redundant servers, each operating with three or more stratum 1 or stratum 2 servers in client/server modes, as well as all other members of the group in symmetric modes.

Configuration

Server side

Router(config)# ntp master [stratum]

The default value of stratum is 8.

Client side

Router(config)# ntp server server_ip

Broadcast Mode

Configuration

Server Side

Router(config)# int e0/0
Router(config-if)# ntp broadcast

Client Side

Router(config)# int e0/0
Router(config-if)# ntp broadcast client

Show Status

Router# show ntp status

results matching ""

    No results matching ""