Configure the Network Time Protocol
The Network Time Protocol (NTP) provides the mechanisms to synchronize time and coordinate time distribution in a large, diverse network. NTP uses a returnable-time design in which a distributed subnet of time servers operating in a self-organizing, hierarchical master-slave configuration synchronizes local clocks within the subnet and to national time standards by means of wire or radio. The servers also can redistribute reference time using local routing algorithms and time daemons.
NTP is defined in RFC 1305, Network Time Protocol (Version 3) Specification, Implementation and Analysis.
To configure NTP on the router, include the
ntpstatement at the[edit system]hierarchy level:[edit system]ntp {authentication-keynumbertypetypevaluepassword;boot-serveraddress;broadcast <address> <keykey-number> <versionvalue> <ttlvalue>;broadcast-client;multicast-client <address>;peeraddress<keykey-number> <versionvalue> <prefer>;serveraddress<keykey-number> <versionvalue> <prefer>;trusted-key [key-numbers];}To configure NTP properties, you can do one or more of the following:
- Configure the NTP Boot Server
- Configure the NTP Time Server and Time Services
- Configure NTP Authentication Keys
- Configure the Router to Listen for Broadcast Messages
- Configure the Router to Listen for Multicast Messages
When configuring NTP, you do not actively configure time servers. Rather, all clients also are servers. An NTP server is not believed unless it, in turn, is synchronized to another NTP server—which itself must be synchronized to something upstream, eventually terminating in a high-precision clock.
If the time difference between the local router clock and the NTP server clock is more than 128 milliseconds, but less than 128 seconds, the clocks are slowly stepped into synchronization. However, if the difference is more than 128 seconds, the clocks are not synchronized. You must set the time on the local router so that the difference is less than 128 seconds to start the synchronization process. On the local router, you set the date and time using the
set datecommand. To set the time automatically, use theboot-serverstatement at the[edit system ntp]hierarchy level, specifying the address of an NTP server.