Setting the Router As the NTP Master for the Network

Problem

You want to use the router as an NTP server to act as the primary time source for the network.

Solution

There is no need for a dedicated NTP server; you can pick one or two routers to act as authoritative NTP servers for the whole network. (The router should have a calendar function):

Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#clock timezone EST 5
Router(config)#clock summer-time EDT recurring
Router(config)#clock calendar-valid
Router(config)#ntp master 8
Router(config)#end
Router# 

 

Discussion

When no authoritative time sources are available, and you still need to synchronize clocks throughout a network, you can configure a router to act as an NTP master server. Although this situation should be considered as a last resort, the router can become a "self-professed" NTP master, even if it is not actually synchronized from an accurate clock.

NTP provides two important services, accurate time setting and clock synchronization. Enabling a router to become a NTP master will not guarantee accurate time, but it will ensure that all network components' time remain synchronized. This distinction is important because routers acting as NTP masters can synchronize their entire network to an incorrect time. However, if the reliable time sources that your network uses become unreachable for any length of time, it is often useful to at least keep the clocks synchronized, even if they aren't completely accurate.

For this reason, we recommend that if your routers provide master NTP services, they should never advertise themselves as Stratum 1 servers. Timekeeping instability can occur on networks with both legitimate NTP time sources and router NTP masters. This is because NTP clients cannot distinguish between legitimate time sources and a router acting as a NTP master. So please use caution when configuring this feature.

Setting a router to act as a NTP master can interrupt legitimate time sources.

In the example above the NTP master is set to the relatively safe Stratum level 8. In most cases, this will prevent the router from being preferred over valid time sources, since NTP clients tend to synchronize to the lowest available Stratum server, assuming their clock is sane.

For obvious reasons, only routers with battery-protected timers or calendars are good candidates to become NTP masters. Otherwise, a power failure or reload of a single router could cause the entire network to become unsynchronized. For increased resilience, the design should include a minimum of two NTP master routers with peering configured between them.

See Also

Recipe 14.3; Recipe 14.4; Recipe 14.5

Router Configuration and File Management

Router Management

User Access and Privilege Levels

TACACS+

IP Routing

RIP

EIGRP

OSPF

BGP

Frame Relay

Handling Queuing and Congestion

Tunnels and VPNs

Dial Backup

NTP and Time

DLSw

Router Interfaces and Media

Simple Network Management Protocol

Logging

Access-Lists

DHCP

NAT

First Hop Redundancy Protocols

IP Multicast

IP Mobility

IPv6

MPLS

Security

Appendix 1. External Software Packages

Appendix 2. IP Precedence, TOS, and DSCP Classifications

Index



Cisco IOS Cookbook
Cisco IOS Cookbook (Cookbooks (OReilly))
ISBN: 0596527225
EAN: 2147483647
Year: 2004
Pages: 505

Flylib.com © 2008-2020.
If you may any questions please contact us: flylib@qtcs.net