Juniper Networks, Inc.
1194 North Mathilda Avenue
Sunnyvale, California 94089
USA
408-745-2000
www.juniper.net
Juniper Networks, Junos, Steel-Belted Radius, NetScreen, and ScreenOS are registered trademarks of Juniper Networks, Inc. in the United
States and other countries. The Juniper Networks Logo, the Junos logo, and JunosE are trademarks of Juniper Networks, Inc. All other
trademarks, service marks, registered trademarks, or registered service marks are the property of their respective owners.
Juniper Networks assumes no responsibility for any inaccuracies in this document. Juniper Networks reserves the right to change, modify,
transfer, or otherwise revise this publication without notice.
Junos®OS Time Management Administration Guide for Routing Devices
The information in this document is current as of the date on the title page.
YEAR 2000 NOTICE
Juniper Networks hardware and software products are Year 2000 compliant. Junos OS has no known time-related limitations through the
year 2038. However, the NTP application is known to have some difficulty in the year 2036.
END USER LICENSE AGREEMENT
The Juniper Networks product that is the subject of this technical documentation consists of (or is intended for use with) Juniper Networks
software. Use of such software is subject to the terms and conditions of the End User License Agreement (“EULA”) posted at
http://www.juniper.net/support/eula.html. By downloading, installing or using such software, you agree to the terms and conditions of
To obtain the most current version of all Juniper Networks®technical documentation,
see the product documentation page on the Juniper Networks website at
http://www.juniper.net/techpubs/.
If the information in the latest release notes differs from the information in the
documentation, follow the product Release Notes.
Juniper Networks Books publishes books by Juniper Networks engineers and subject
matter experts. These books go beyond the technical documentation to explore the
nuances of network architecture, deployment, and administration. The current list can
be viewed at http://www.juniper.net/books.
Supported Platforms
For the features described in this document, the following platforms are supported:
Time Management Administration Guide for Routing Devices
Using the Examples in This Manual
If you want to use the examples in this manual, you can use the load merge or the load
merge relative command. These commands cause the software to merge the incoming
configuration into the current candidate configuration. The example does not become
active until you commit the candidate configuration.
If the example configuration contains the top level of the hierarchy (or multiple
hierarchies), the example is a full example. In this case, use the load merge command.
If the example configuration does not start at the top level of the hierarchy, the example
is a snippet. In this case, use the load merge relative command. These procedures are
described in the following sections.
Merging a Full Example
To merge a full example, follow these steps:
1. From the HTML or PDF version of the manual, copy a configuration example into a
text file, save the file with a name, and copy the file to a directory on your routing
platform.
For example, copy thefollowingconfigurationto a file and name the file ex-script.conf.
Copy the ex-script.conf file to the /var/tmp directory on your routing platform.
system {
scripts {
commit {
file ex-script.xsl;
}
}
}
interfaces {
fxp0 {
disable;
unit 0 {
family inet {
address 10.0.0.1/24;
}
}
}
}
2. Merge the contents of the file into your routing platform configuration by issuing the
Indicates a choice between the mutually
exclusivekeywords or variables on either
side of the symbol. The set of choices is
often enclosed in parentheses for clarity.
same lineas the configuration statement
to which it applies.
Encloses a variable for which you can
substitute one or more values.
Identifies a level in the configuration
hierarchy.
Identifies a leaf statement at a
configuration hierarchy level.
broadcast | multicast
(string1 | string2 | string3)
rsvp { # Required for dynamic MPLS onlyIndicates a comment specified on the
Representsgraphicaluser interface (GUI)
items you click or select.
About the Documentation
ExamplesDescriptionConvention
•
In the Logical Interfaces box, select
All Interfaces.
•
To cancel the configuration, click
Cancel.
> (bold right angle bracket)
Documentation Feedback
We encourage you to provide feedback, comments, and suggestions so that we can
improve the documentation. You can send your comments to
techpubs-comments@juniper.net, or fill out the documentation feedback form at
https://www.juniper.net/cgi-bin/docbugreport/. If you are using e-mail, be sure to include
the following information with your comments:
•
Document or topic name
•
URL or page number
•
Software release version (if applicable)
Requesting Technical Support
Technical productsupport is availablethrough theJuniper Networks Technical Assistance
Center (JTAC). If you are a customer with an active J-Care or JNASC support contract,
or are covered under warranty, and need post-sales technical support, you can access
our tools and resources online or open a case with JTAC.
Separates levels in a hierarchy of menu
selections.
In the configuration editor hierarchy,
select Protocols>Ospf.
•
JTAC policies—For a complete understanding of our JTAC procedures and policies,
review the JTAC User Guide located at
JTAC hours of operation—The JTAC centers have resources available 24 hours a day,
7 days a week, 365 days a year.
Self-Help Online Tools and Resources
For quick and easy problem resolution, Juniper Networks has designed an online
self-service portal called the Customer Support Center (CSC) that provides you with the
following features:
Find solutions and answer questions using our Knowledge Base: http://kb.juniper.net/
•
Download the latest versions of software and review release notes:
http://www.juniper.net/customers/csc/software/
•
Search technical bulletins for relevant hardware and software notifications:
http://kb.juniper.net/InfoCenter/
•
Join and participate in the Juniper Networks Community Forum:
http://www.juniper.net/company/communities/
•
Open a case online in the CSC Case Management tool: http://www.juniper.net/cm/
To verifyservice entitlement by product serialnumber,use ourSerial Number Entitlement
(SNE) Tool: https://tools.juniper.net/SerialNumberEntitlementSearch/
Opening a Case with JTAC
You can open a case with JTAC on the Web or by telephone.
•
Use the Case Management tool in the CSC at http://www.juniper.net/cm/.
•
Call 1-888-314-JTAC (1-888-314-5822 toll-free in the USA, Canada, and Mexico).
For international or direct-dial options in countries without toll-free numbers, see
Network Time Protocol (NTP) is a widely used protocol used to synchronize the clocks
of routers and other hardware devices on the Internet. Primary NTP servers are
synchronizedto areferenceclock directlytraceableto Coordinated Universal Time(UTC).
Reference clocks include GPS receivers and telephone modem services, NTP accuracy
expectations depend on the environment application requirements, however, NTP can
generally maintain time to within tens of milliseconds over the public internet.
NTP isdefined inthe RFC5905: Network Time Protocol Version4: Protocol and Algorithms
Specification
Junos devices can be configured to act as an NTP client, a secondary NTP server, or a
primary NTP server. These variations are as follows:
•
Primary NTP Server—Primary NTP servers are synchronized to a reference clock that
is directly traceableto UTC. These servers then re-distribute thistime data downstream
to other Secondary NTP servers or NTP clients.
•
Secondary NTP Server—Secondary NTP servers are synchronized to a primary or
secondary NTP server. These servers then re-distribute this data downstream to other
Secondary NTP servers or NTP clients.
Time Management Administration Guide for Routing Devices
•
NTP Client—NTP clients aresynchronizedto aprimary or secondaryNTP server.Clients
do not re-distribute this time data to other devices.
NOTE: The NTP subnet includes a number of widely accessible public primary
time servers that can be used as a network’s primary NTP server. Juniper
Networks strongly recommends that you authenticate any primary servers
you use.
Each device on your network can be configured to run in one or more of the following
NTP modes:
•
Broadcast Mode—One or more devices is set up to transmit time information to a
specified broadcast or multicast address. Other devices listen time sync packets on
these addresses. This mode is less accurate than the client/server mode.
•
Client/Server Mode—Devices are organized hierarchically across the network in
client/server relationships.
NOTE: QFX devices cannot be act as NTP servers, only clients.
•
Symmetric Active (peer) Mode—Two or more devices are configured as NTP server
peers to provide redundancy.
By default, if an NTP client time drifts so that the difference in time from the NTP server
exceeds 128 milliseconds, the NTP client is automatically stepped back into
synchronization. The NTP client will still synchronize with the server even if the offset
betweenthe NTP client and server exceeds the 1000-secondthreshold.You can manually
request that adevice synchronize with an NTP serverby using the set datentp operational
command on the router. On devices running Junos OS that have dual Routing Engines,
the backup Routing Engine synchronizes directly with the master Routing Engine.
For more details on the Network Time Protocol, go to the Network Time Foundation
website at http://www.ntp.org.
NOTE: NTP is required for Common Criteria compliance. For more information
on the Common Criteria certification, see Public Sector Certifications.
In Junosoperating system (Junos OS) Release 11.2or later, NTPsupports IPv4VPN routing
and forwarding (VRF) requests. This enables an NTP server running on a provider edge
(PE) router to respond to NTP requests from a customer edge (CE) router. As a result,
a PE router can process anyNTP request packet coming fromdifferent routing instances.
In Junos OS Release 11.4 and later, NTP also supports IPv6 VRF requests.
Related
Documentation
Synchronizing and Coordinating Time Distribution Using NTP on page 13•
• Example: Configuring NTP as a Single Time Source for Router and Switch Clock
Synchronization on page 17
Understanding NTP Time Servers
The IETF defined the NetworkTime Protocol(NTP) tosynchronize the clocks ofcomputer
systems connected to each other over a network. Most large networks have an NTP
server that ensures that time on all devices is synchronized, regardless of the device
location. If you useone or more NTP servers on your network, ensure you include the NTS
server addresses in your Junos OS configuration.
When configuring the NTP, you can specify which system on the network is the
authoritative time source, or time server, and how time is synchronized between systems
on the network. To do this, you configure the router, switch, or security device to operate
in one of the following modes:
•
Client mode—In this mode, the local router or switch can be synchronized with the
remote system, but the remote system cannever be synchronized with thelocal router
or switch.
•
Symmetricactive mode—Inthis mode,the local router orswitch andthe remote system
can synchronize with each other. You use this mode in a network in which either the
local router or switch or the remote system might be a better source of time.
•
Broadcast mode—In this mode, the local router or switch sends periodic broadcast
messages to a client population at the specified broadcast or multicast address.
Normally, you include this statement only when the local router or switch is operating
as a transmitter.
•
Server mode—In this mode, the local router or switch operates as an NTP server.
NOTE: Symmetric active mode can be initiated by either the local or the
remote system. Only one system needs to be configured to do so. This
means that the local system can synchronize with any system that offers
symmetric active mode without any configuration whatsoever. However,
we strongly encourage you to configure authentication to ensure that the
local system synchronizes only with known time servers.
Time Management Administration Guide for Routing Devices
NOTE: In NTP server mode, the Junos OS supports authentication as
follows:
•
If the NTP request from the client comes with an authentication key
(such as a key ID and message digest sent with the packet), the request
is processed and answered based on the authentication key match.
•
If the NTP request from the client comes without any authentication key,
the request is processed and answered without authentication.
Related
Documentation
• Configuring the NTP Time Server and Time Services
• Example: Configuring NTP as a Single Time Source for Router and Switch Clock
Modifying the Default Time Zone for a Router or Switch Running Junos OS on page 12
•
Synchronizing and Coordinating Time Distribution Using NTP on page 13
•
Configuring the NTP Time Server and Time Services on page 14
•
Example: Configuring NTP as a Single Time Source for Router and Switch Clock
Synchronization on page 17
•
Configuring NTP Authentication Keys on page 18
•
Configuring the Router or Switch to Listen for Broadcast Messages Using
NTP on page 19
•
Configuring the Router or Switch to Listen for MulticastMessagesUsing NTP on page 19
•
Updating the IANA Time Zone Database on Junos Devices on page 20
Setting the Date and Time Locally
You can set the device time on the command-line using the set date operational
command:
To set the time in your Junos OS device, you can either configure it manually, or your
device can take a system time from an Network Time Protocol (NTP) server. If you do
not have access to an NTP server, you can configure Junos OS to keep its own local time
using an onboard clock.
To set time locally:
1. From operational mode, manually set the date and time.
Because this is an operational-mode command, there is noneed to perform a commit
operation.
user@host> set date YYYYMMDDhhmm.ss
For example:
user@host> set date 201307251632
Thu Jul 25 16:32:00 PDT 2013
Time Management Administration Guide for Routing Devices
The show system uptime command provides the following information: current time,
last boot time, protocols start time, last configuration commit time.
user@host> show system uptime
Current time: 2013-07-25 16:33:38 PDT
System booted: 2013-07-11 17:14:25 PDT (1w6d 23:19 ago)
Protocols started: 2013-07-11 17:16:35 PDT (1w6d 23:17 ago)
Last configured: 2013-07-23 12:32:42 PDT (2d 04:00 ago) by user
4:33PM up 13 days, 23:19, 1 user, load averages: 0.00, 0.01, 0.00
Related
Documentation
Configuring NTP
Time Management Administration Guide for Routing Devices•
The Network Time Protocol (NTP) provides the mechanisms to synchronize time and
coordinate time distribution in a large, diverse network. Debugging and troubleshooting
are much easier when the timestamps in the log files of all the routers or switches are
synchronized,because events that spanthe networkcan be correlatedwith synchronous
entries in multiple logs. We recommend using the Network Time Protocol (NTP) to
synchronize the system clocks of routers, switches, and other network equipment.
To configure NTP:
1. Configure Junos OS to retrieve the time when it first boots up.
Use the boot-server statement with the IP address of your NTP server. If DNS is
configured, you can use a domain name instead of an IP address.
[edit system ntp]
user@host# set boot-server (name | ip-address)
For example, set an IP address of 172.16.1.1 for your NTP server.
[edit system ntp]
user@host# set boot-server 172.16.1.1
For example, set a domain name. In this example, the domain name is provided by
pool.ntp.org.
[edit system ntp]
user@host# set boot-server 0.north-america.pool.ntp.org
2. (Optional) Configure one or more reference NTP servers to keep the device
synchronized with periodic updates.
It is a good practice to do this, as the Junos OS device can remain up for a long time,
and therefore the clock can drift.
[edit system ntp]
user@host# set server (name | ip-address)
For example, set an IP address of 172.16.1.1 for your NTP server.
[edit system ntp]
user@host# set server 172.16.1.1
For example, set a domain name provided by pool.ntp.org.
[edit system ntp]
user@host# set server 0.north-america.pool.ntp.org
3. (Optional) Set the local time zone to match the device’s location.
Universal Coordinated Time (UTC) is the default. Many administrators prefer to keep
all their devices configured to use the UTC time zone. This approach has the benefit
of allowing you to easily compare the time stamps of logs and other events across a
network of devices in many different time zones.
On the other hand, setting the time zone allows Junos OS to present the time in the
correct local format.
[edit system ntp]
user@host# set time-zone time-zone
For example:
[edit system ntp]
user@host# set time-zone America/Los_Angeles
4. Verify the configuration.
Check the system uptime. This command provides the current time, when the device
was last booted, whenthe protocolsstarted,and when the devicewaslast configured.
user@host> show system uptime
Current time: 2013-07-25 16:33:38 PDT
System booted: 2013-07-11 17:14:25 PDT (1w6d 23:19 ago)
Protocols started: 2013-07-11 17:16:35 PDT (1w6d 23:17 ago)
Last configured: 2013-07-23 12:32:42 PDT (2d 04:00 ago) by user
4:33PM up 13 days, 23:19, 1 user, load averages: 0.00, 0.01, 0.00
Check the NTP server status and associations of the clocking sources used by your
device.
user@host> show ntp associations
remote refid st t when poll reach delay offset jitter
==============================================================================
Time Management Administration Guide for Routing Devices
Modifying the Default Time Zone for a Router or Switch Running Junos OS
The default local time zone on the router is UTC (Coordinated Universal Time, formerly
known as Greenwich Mean Time, or GMT). To modify the local time zone, include the
time-zone statement at the [edit system] hierarchy level:
[edit system]
time-zone (GMThour-offset | time-zone);
You can use the GMT hour-offset option to set the time zone relative to UTC (GMT) time.
By default, hour-offset is 0. You can configure this to be a value in the range from –14 to
+12.
You can also specify time-zone as a string such as PDT (Pacific Daylight Time) or WET
(Western European Time), or specify the continent and major city.
NOTE: Junos OS complies with the POSIX time-zone standard, which is
counter-intuitive to the way time zones are generally indicated relative to
UTC.A time zone ahead of UTC (east of the Greenwich meridian) is commonly
indicated as GMT +n; for example, the Central European Time (CET) zone is
indicated as GMT +1. However, this is not true for POSIX time zone
designations. POSIX indicates CET as GMT-1. If you include the set system
time-zone GMT+1 statement for a router in the CET zone, your router time will
be set to one hour behind GMT, or two hours behind the actual CET time. For
this reason, you might find it easier to use the POSIX time-zone strings, which
you can list by entering set system time-zone ?.
Related
Documentation
For the time zone change to take effect for all processes running on the router or switch,
you must reboot the router or switch.
The followingexampleshows how to change thecurrent time zoneto America/New_York:
[edit]
user@host# set system time-zone America/New_York
[edit]
user@host# show
system {
time-zone America/New_York;
}
NTP Overview on page 3•
• Updating the IANA Time Zone Database on Junos Devices on page 20
Synchronizing and Coordinating Time Distribution Using NTP
Using NTP to synchronize and coordinate time distribution in a large network involves
these tasks:
1.
Configuring NTP on page 13
2.
Configuring the NTP Boot Server on page 13
3.
Specifying a Source Address for an NTP Server on page 13
Configuring NTP
To configure NTP on the router or switch, include the ntp statement at the [edit system]
hierarchy level:
[edit system]
ntp {
authentication-key number type type value password;
boot-server (address | hostname);
broadcast <address> <key key-number> <version value> <ttl value>;
broadcast-client;
multicast-client <address>;
peer address <key key-number> <version value> <prefer>;
server address <key key-number> <version value> <prefer>;
source-address source-address;
trusted-key [ key-numbers ];
}
Chapter 2: Configuring Time
Configuring the NTP Boot Server
When you boot the router or switch, it issues an ntpdate request, which polls a network
server to determine the localdate and time. You needto configure aserver that therouter
or switch uses to determine the time when the router or switch boots. If you configure
an NTP boot server, then when the router or switch boots, it immediately synchronizes
with the boot server even if the NTP process is explicitly disabled or if the time difference
between the client and the boot server exceeds the threshold value of 1000 seconds.
To configure the NTP boot server, include the boot-server statement at the [edit system
ntp] hierarchy level:
[edit system ntp]
boot-server (address | hostname);
Specify theaddress ofthe network server. You must specify an IP address or a hostname.
Specifying a Source Address for an NTP Server
For IPversion 4(IPv4), youcan specifythat ifthe NTPserver configured at the [edit system
ntp] hierarchy level is contacted on one of the loopback interface addresses, the reply
always uses a specific source address. This is useful for controlling which source address
NTP will use to access your network when it is either responding to an NTP client request
from your network or when it itself is sending NTP requests to your network.
Time Management Administration Guide for Routing Devices
To configure the specific source address that the reply will always use, and the source
address that requests initiated by NTP server will use, include the source-address
statement at the [edit system ntp] hierarchy level:
[edit system ntp]
source-address source-address;
source-address is a valid IP address configured on one of the router or switch interfaces.
NOTE: If a firewall filter is applied on the loopback interface, ensure that the
source-address specified for the NTP server at the [edit system ntp] hierarchy
level is explicitly included as one of the match criteria in the firewall filter.
This enables the Junos OS to accept traffic on the loopback interface from
the specified source address.
The following example shows a firewall filter with the source address
10.0.10.100 specified in the from statement included at the [edit firewall filter
firewall-filter-name] hierarchy:
[edit firewall filter Loopback-Interface-Firewall-Filter]
term Allow-NTP {
from {
source-address {
172.17.27.46/32; // IP address of the NTP server
10.0.10.100/32; // Source address specified for the NTP server
}
then accept;
}
}
If no source-address is configured for the NTP server, include the primary
address of the loopback interface in the firewall filter.
Related
Documentation
NTP Overview on page 3•
• Understanding NTP Time Servers on page 5
• Example: Configuring NTP as a Single Time Source for Router and Switch Clock
Synchronization on page 17
Configuring the NTP Time Server and Time Services
When you use NTP, configure the router or switch to operate in one of the following
modes:
The following topics describe how to configure these modes of operation:
1.
Configuring the Router or Switch to Operate in Client Mode on page 15
2.
Configuring the Router or Switch to Operate in Symmetric Active Mode on page 15
3.
Configuring the Router or Switch to Operate in Broadcast Mode on page 16
4.
Configuring the Router or Switch to Operate in Server Mode on page 16
Configuring the Router or Switch to Operate in Client Mode
To configure the local router or switch to operate in client mode, include the server
statement and other optional statements at the [edit system ntp] hierarchy level:
[edit system ntp]
server address <key key-number> <version value> <prefer>;
authentication-key key-number type type value password;
boot-server address;
trusted-key [ key-numbers ];
Specify theaddress ofthe system actingas the time server. You must specify an address,
not a hostname.
Chapter 2: Configuring Time
To include an authentication key in all messages sent to the time server, include the key
option. The key corresponds to the key number you specify in the authentication-key
statement, as described in “Configuring NTP Authentication Keys” on page 18.
By default, the router or switch sends NTP version 4 packets to the time server. To set
the NTP version level to 1, 2, or 3, include the version option.
If you configure more thanone timeserver,you can markone server preferred by including
the prefer option.
For information about how to configure trusted keys, see “ConfiguringNTP Authentication
Keys” on page 18. For information about how to configure an NTP boot server, see
“Configuring the NTP Boot Server” on page 13. For information about how to configure
the router or switch to operate in server mode, see “Configuring the Router or Switch to
Operate in Server Mode” on page 16.
The following example shows how to configure the router or switch to operate in client
mode:
[edit system ntp]
authentication-key 1 type md5 value "$9$EgfcrvX7VY4ZEcwgoHjkP5Q3CuREyv87";
boot-server 10.1.1.1;
server 10.1.1.1 key 1 prefer;
trusted-key 1;
Configuring the Router or Switch to Operate in Symmetric Active Mode
To configure the local router or switch to operate in symmetric active mode, include the
peer statement at the [edit system ntp] hierarchy level:
Time Management Administration Guide for Routing Devices
Specify theaddress of the remote system. You must specify an address, nota hostname.
To include an authentication key in all messages sent to the remote system, include the
key option. The key corresponds to the key number you specify in the authentication-key
statement, as described in “Configuring NTP Authentication Keys” on page 18.
By default, the router or switch sends NTP version 4 packets to the remote system. To
set the NTP version level to 1, 2 or 3, include the version option.
If you configure more than one remote system, you can mark one system preferred by
including the prefer option:
Specify the broadcast address on one of the local networks or a multicast address
assigned to NTP. You must specify an address, not a hostname. If the multicast address
is used, it must be 224.0.1.1.
To include an authentication key in all messages sent to the remote system, include the
key option. The key corresponds to the key number you specify in the authentication-key
statement, as described in “Configuring NTP Authentication Keys” on page 18.
By default, the router or switch sends NTP version 4 packets to the remote system. To
set the NTP version level to 1, 2, or 3, include the version option.
Configuring the Router or Switch to Operate in Server Mode
In server mode, the router or switch acts as an NTP server for clients when the clients are
configured appropriately. The only prerequisite for “ server mode” is that the router or
switch must be receiving time from another NTP peer or server. No other configuration
is necessary on the router or switch.
To configure the local router or switch to operate as an NTP server, include the following
statements at the [edit system ntp] hierarchy level:
[edit system ntp]
authentication-key key-number type type value password;
server address <key key-number> <version value> <prefer>;
trusted-key [ key-numbers ];
Specify theaddress ofthe system actingas the time server. You must specify an address,
not a hostname.
To include an authentication key in all messages sent to the time server, include the key
option. The key corresponds to the key number you specify in the authentication-key
statement, as described in “Configuring NTP Authentication Keys” on page 18.
By default, the router or switch sends NTP version 4 packets to the time server. To set
the NTP version level to 1,or 2, or 3, include the version option.
If you configure more thanone timeserver,you can markone server preferred by including
the prefer option.
For information about how to configure trusted keys, see “ConfiguringNTP Authentication
Keys” on page 18. For information about how to configure the router or switch to operate
in client mode, see “Configuring the Router or Switch to Operate in Client Mode” on
page 15.
The following example shows how to configure the router or switch to operate in server
mode:
[edit system ntp]
authentication-key 1 type md5 value "$9$txERuBEreWx-wtuLNdboaUjH.T3AtOESe";
server 172.17.27.46 prefer;
trusted-key 1;
NOTE: When a host is added as an NTP server, it resolves to an IP address
prior to being adding to the configuration. When using a public NTP server,
the host might resolve to different IP addresses.
If the resolved IP address becomes unreachable for any reason, the switch
cannot access the NTP server. In order to leverage public NTP pool entities,
this functionality has been modified so that a host is accepted as a string
without DNS resolution.
Related
Documentation
Understanding NTP Time Servers on page 5•
• Example: Configuring NTP as a Single Time Source for Router and Switch Clock
Synchronization on page 17
Example: Configuring NTP as a Single Time Source for Router and Switch Clock
Synchronization
Debugging and troubleshooting are much easier when the timestamps in the log files of
all the routers or switches are synchronized, because events that span the network can
be correlated with synchronous entries in multiple logs. We strongly recommend using
the Network Time Protocol (NTP) to synchronize the system clocks of routers, switches,
and other network equipment.
By default, NTP operates in an entirely unauthenticated manner. If a malicious attempt
to influence the accuracy of a router or switch’s clock succeeds, it could have negative
effects on system logging, make troubleshooting and intrusion detection more difficult,
and impede other management functions.
The following sample configuration synchronizes allthe routers or switches in the network
to a single time source. We recommend using authentication to make sure that the NTP
peer istrusted. The boot-server statement identifies the server fromwhich the initial time
Time Management Administration Guide for Routing Devices
of day and date is obtained when the router boots. The server statement identifies the
NTP server used for periodic time synchronization. The authentication-key statement
specifies that an HMAC-Message Digest 5 (MD5) scheme should be used to hash the
key value for authentication, which prevents the router or switch from synchronizing with
an attacker’s host posing as the time server.
[edit]
system {
ntp {
authentication-key 2 type md5 value "$9$aH1j8gqQ1gjyjgjhgjgiiiii"; # SECRET-DATA
boot-server 10.1.4.1;
server 10.1.4.2;
}
}
Related
NTP Overview on page 3•
Documentation
• Understanding NTP Time Servers on page 5
• authentication-key
• boot-server
• server
• show ntp associations on page 48
• show ntp status on page 50
Configuring NTP Authentication Keys
Time synchronization can be authenticated to ensure that the local router or switch
obtains its time services only from known sources. By default, network time
synchronization is unauthenticated. The system will synchronize to whatever system
appears to have the most accurate time. We strongly encourage you to configure
authentication of network time services.
To authenticate other time servers, include the trusted-key statement at the [edit system
ntp] hierarchy level. Only time servers transmitting network time packets that contain
one of the specified key numbers and whose key matches the value configured for that
key number are eligible tobe synchronizedto. Othersystems can synchronize to the local
router without being authenticated.
[edit system ntp]
trusted-key [ key-numbers ];
Each key can be any 32-bit unsigned integer except 0. Include the key option in the peer,
server, or broadcast statements to transmit the specified authentication key when
transmitting packets. The key is necessary if the remote system has authentication
enabled so that it can synchronize to the local system.
To define the authentication keys, include the authentication-key statement at the [edit
authentication-key key-number type type value password;
number is the key number, type is the authentication type (only Message Digest 5 [MD5]
is supported), and password is the password for this key. The key number, type, and
password must match on all systems using that particular key for authentication.
Related
Documentation
Understanding NTP Time Servers on page 5•
• Example: Configuring NTP as a Single Time Source for Router and Switch Clock
Synchronization on page 17
Configuring the Router or Switch to Listen for Broadcast Messages Using NTP
When you are using NTP, you can configure the local router or switch to listen for
broadcast messages on the local network to discover other servers on the same subnet
by including the broadcast-client statement at the [edit system ntp] hierarchy level:
[edit system ntp]
broadcast-client;
When the router or switch detects a broadcast message for the first time, it measures
the nominal network delay using a brief client-server exchange with the remote server.
It thenenters broadcastclient mode, inwhich it listens for, and synchronizes to, succeeding
broadcast messages.
To avoid accidental or malicious disruption in this mode, both the local and remote
systems must use authentication and the same trusted key and key identifier.
Related
Documentation
Configuring the Router or Switch to Listen for MulticastMessagesUsing NTP on page 19•
• Configuring the NTP Time Server and Time Services on page 14
• Example: Configuring NTP as a Single Time Source for Router and Switch Clock
Synchronization on page 17
Configuring the Router or Switch to Listen for Multicast Messages Using NTP
When you are usingNTP,you can configure thelocal router orswitch to listen for multicast
messages on the local network to discover otherservers onthe same subnet by including
the multicast-client statement at the [edit system ntp] hierarchy level:
[edit system ntp]
multicast-client <address>;
When the router or switch receives a multicast message for the first time, it measures
the nominal network delay using a brief client-server exchange with the remote server.
It thenenters multicastclient mode, in which it listens for, and synchronizes to, succeeding
multicast messages.
You can specifyone ormore IPaddresses. (Youmust specifyan address, nota hostname.)
If you do, the router or switch joins those multicast groups. If you do not specify any
addresses, the software uses 224.0.1.1.
Time Management Administration Guide for Routing Devices
To avoid accidental or malicious disruption in this mode, both the local and remote
systems must use authentication and the same trusted key and key identifier.
Related
Documentation
Configuring the Router or Switch to Listen for Broadcast Messages Using NTP on
•
page 19
• Configuring the NTP Time Server and Time Services on page 14
• Example: Configuring NTP as a Single Time Source for Router and Switch Clock
Synchronization on page 17
Updating the IANA Time Zone Database on Junos Devices
Junos devices use the tz database, also known as the IANA Time Zone Database to
manage time zones. This database is periodically updated by IANA to reflect political
and time changes. As such, you may need from time to time to update this file to ensure
the Junos devices continue to accurately reflect worldwide time zones and daylight
savings time intervals.
To update the IANA Time Zone Database, perform the following steps:
1.
Importing and Installing Time Zone Files on page 20
2.
Configuring a Custom Time Zone on page 21
Importing and Installing Time Zone Files
The IANA TimeZone Database is maintainedby the InternetAssigned Numbers Authority
(IANA), which is a department of the Internet Corporation for Assigned Names and
Numbers (ICANN). You can download the latest IANA Time Zone Database file from the
following URL: http://www.iana.org/time-zones.
The following steps will guide you through one method ofinstalling thefile to your device.
However, depending on your network access and other preferences, you may need to
modify these steps.
1. Log into the Junos device.
2. If you are in the CLI interface, open the shell interface.
device@user# start shell
3. Create a tz directory in the /var/tmp and navigate to that directory.
# mkdir /var/tmp/tz
# cd /var/tmp/tz
4. Using FTP, download the time zone files archive.
NOTE: FTP must be enabled on your device before you can use FTP. FTP
is enabled by adding the ftp statement into the [edit system services]
hierarchy.
NOTE: If needed, you can edit the above untarred files to createor modify
the time zones.
5. Select the names of time zone files to compile and feed them to the following script.
For example, to generate northamerica and asia tz files:
# /usr/libexec/ui/compile-tz northamerica asia
6. Enable the use of the generated tz files using the CLI:
[edit]
# set system use-imported-time-zones
[edit]
# set system time-zone ?
This should show the newly generated tz files in /var/db/zoneinfo/.
7. Set the time zone and commit the configuration:
[edit]
# set system time-zone <your-time-zone>
# commit
8. Verify that the time zone change has taken effect:
[edit]
# run show system uptime
Configuring a Custom Time Zone
To use a custom time zone, follow these steps:
1. Download a time zones archive (from a known or designated source) to the router or
switch. Compile thetime zonearchive using the zic time zone compiler, whichgenerates
tz files.
2. Using the CLI, configure the router or switch to enable the use of the generated tz files
as follows:
[edit]
user@host# set system use-imported-time-zones
3. Display the imported time zones (saved in the directory /var/db/zoneinfo/):
[edit]
user@host# set system time-zone ?
If you do not configure the router to use imported time zones, the Junos OS default
time zones are shown (saved in the directory /usr/share/zoneinfo/).
Related
Documentation
• Modifying the Default Time Zone for a Router or Switch Running Junos OS on page 12
Release InformationStatement introduced before Junos OS Release 7.4.
Statement introduced in Junos OS Release 9.0 for EX Series switches.
DescriptionConfigure the server that NTP queries when the router or switch boots to determine the
local date and time.
When you boot the router or switch, it issues an ntpdate request, which polls a network
server to determine the localdate and time. You needto configure aserver that therouter
or switch uses to determine the time when the router or switch boots. You can either
configure an IP address or a hostname for the boot server. If you configure a hostname
instead of an IP address, the ntpdate request resolves the hostname to an IP address
when the router or switch boots up.
Chapter 3: Configuration Statements
Options• address—The IP address of an NTP boot server.
Required Privilege
Level
Related
Documentation
If you configure an NTP boot server, then when the router or switch boots, it immediately
synchronizes with the boot server even if the NTP process is explicitly disabled or if the
time difference between the client and the boot server exceeds the threshold value of
1000 seconds.
• hostname—The hostname of an NTP boot server.
system—To view this statement in the configuration.
system-control—To add this statement to the configuration.
Release InformationStatement introduced before Junos OS Release 7.4.
Statement introduced in Junos OS Release 9.0 for EX Series switches.
DescriptionConfigure thelocalrouter or switchto operatein broadcastmode withthe remote system
at the specified address. In this mode, the local router or switch sends periodic broadcast
messagesto aclient population at thespecified broadcastor multicast address. Normally,
you include this statement only when the local router or switch is operating as a
transmitter.
Optionsaddress—The broadcast address on one of the local networks or a multicast address
assigned to NTP. You must specify an address, not a hostname. If the multicast
address is used, it must be 224.0.1.1.
Required Privilege
Level
Related
Documentation
key key-number—(Optional) All packets sent to the address include authentication fields
that are encrypted using the specified key number.
Range: Any unsigned 32-bit integer
ttl value—(Optional) Time-to-live (TTL) value to use.
Range: 1 through 255
Default: 1
version value—(Optional) Specify the version numberto beused inoutgoing NTP packets.
Range: 1 through 4
Default: 4
system—To view this statement in the configuration.
system-control—To add this statement to the configuration.
• Configuring the NTP Time Server and Time Services on page 14
Release InformationStatement introduced before Junos OS Release 7.4.
Statement introduced in Junos OS Release 9.0 for EX Series switches.
DescriptionFor NTP, configure the local router or switch to operate in symmetric active mode with
the remote system at the specified address. In this mode, the local router or switch and
the remote system can synchronize with each other. This configuration is useful in a
network in which either the local router or switch or the remote system might be a better
source of time.
Optionsaddress—Address of the remote system. You must specify an address, not a hostname.
key key-number—(Optional) All packets sent to the address include authentication fields
that are encrypted using the specified key number.
Range: Any unsigned 32-bit integer
Chapter 3: Configuration Statements
Required Privilege
Level
Related
Documentation
prefer—(Optional) Mark the remote system as the preferred host, which means that if
all other factors are equal, this remote system is chosen for synchronization among
a set of correctly operating systems.
version value—(Optional) Specify the NTP version number to be used in outgoing NTP
packets.
Range: 1 through 4
Default: 4
system—To view this statement in the configuration.
system-control—To add this statement to the configuration.
• Configuring the NTP Time Server and Time Services on page 14
Release InformationStatement introduced before Junos OS Release 7.4.
Statement introduced in Junos OS Release 9.0 for EX Series switches.
DescriptionFor NTP, configure the local router or switch to operate in client mode with the remote
system at the specified address. In this mode, the local router or switch can be
synchronized with the remote system, but the remote system can never be synchronized
with the local router or switch.
If the NTP client time drifts so that the difference in time from the NTP server exceeds
128 milliseconds, the client is automatically stepped back into synchronization. If the
offset between the NTP client and server exceeds the 1000-second threshold, the client
still synchronizes with the server, but it also generates a system log message noting that
the threshold was exceeded.
Optionsaddress—Address of the remote system. You must specify an address, not a hostname.
Required Privilege
Level
Related
Documentation
key key-number—(Optional) Use the specified key number to encrypt authentication
fields in all packets sent to the specified address.
Range: Any unsigned 32-bit integer
prefer—(Optional) Mark the remote system as preferred host, which means that if all
other things are equal, this remote system is chosen for synchronization among a
set of correctly operating systems.
version value—(Optional) Specify the version numberto beused inoutgoing NTP packets.
Range: 1 through 4
Default: 4
system—To view this statement in the configuration.
system-control—To add this statement to the configuration.
• Configuring the NTP Time Server and Time Services on page 14
source-address (NTP, RADIUS, System Logging, or TACACS+)
Syntaxsource-address source-address;
Hierarchy Level[edit system accounting destination radius server server-address],
[edit system accounting destination tacplus server server-address],
[edit system ntp],
[edit system radius-server server-address],
[edit system syslog],
[edit system tacplus-server server-address]
Release InformationStatement introduced before Junos OS Release 7.4.
Statement introduced in Junos OS Release 9.0 for EX Series switches.
DescriptionSpecify a source address for each configured IPv4 or IPv6 TACACS+ server, RADIUS
server, NTP server, or the source address to record in system log messages that are
directed to a remote machine.
Optionssource-address—A valid IP address configured on one of the router or switch interfaces.
For system logging, the address is recorded as the message source inmessages sent
to the remote machines specified in all host hostname statements at the
[edit system syslog] hierarchy level, but not for messages directed to the other
Routing Engine or to the TX Matrix router or TX Matrix Plus router in a routing matrix
based on a TX Matrix router or TX Matrix Plus router.
Chapter 3: Configuration Statements
Required Privilege
Level
Related
Documentation
system—To view this statement in the configuration.
system-control—To add this statement to the configuration.
• Configuring RADIUS Authentication
• Specifying a Source Address for an NTP Server on page 13
• Specifying an Alternative Source Address for System Log Messages
Table 3: show ntp associations Output Fields (continued)
Field DescriptionField Name
Chapter 5: Monitoring Commands
peer-name
Sample Output
show ntp associations
Peer name and status of the peer in the clock selection process:
• space—Discarded because of a high stratum value or failed sanity checks.
• x—Designated "falseticker" by the intersection algorithm.
• .—Culled from the end of the candidate list.
• – —Discarded by the clustering algorithm.
• +—Included in the final selection set.
• #—Selected for synchronization, but the distance exceeds the maximum.
• *—Selected for synchronization.
• o—Selected for synchronization, but the packets-per-second (pps) signal is in use.
user@host> show ntp associations
remote refid st t when poll reach delay offset disp
==============================================================================
*wolfe-gw.junipe tick.ucla.edu 2 u 43 64 377 1.86 0.319 0.08
Table 4: show ntp status Output Fields (continued)
Field DescriptionField Name
Chapter 5: Monitoring Commands
stratum
precision
refid
reftime
state
The stratum of the peer server. Anything greater than1 is a secondary referencesource, and the number
roughlyrepresents the number of hops away from the stratum 1 server.. Stratum 1 is a primary reference,
such as an atomic clock.
The precision of the peer clock, how precisely the frequency and time can be maintained with this
particular timekeeping system.
The total roundtrip delay to the primary reference source, in seconds.rootdelay
The maximum error relative to the primary reference source, in seconds.rootdispersion
An identification number of the peer in use.peer
Reference identifier of the remotepeer. If the reference identifieris not known, this field shows a value
of 0.0.0.0.
The local time, in timestamp format, when the local clock was last updated. If the local clock has
never been synchronized, the value is zero.
The NTP broadcast message polling interval, in seconds.poll
The current time on the local router clock.clock
The current mode of NTP operation, where 1 is symmetric active, 2 is symmetric passive, 3 is client, 4
is server, and 5 is broadcast.
offset
Sample Output
show ntp status
Current estimated offset of the peer, in milliseconds. Indicates the time difference between the
reference clock and the local clock.
The frequency of the clock.frequency
Indicates the magnitude of jitter, in milliseconds, between several time queries.jitter
A measure of how well this clock can maintain a constant frequency.stability
user@host> show ntp status
assID=0 status=0544 leap_none, sync_local_proto, 4 events, event_peer/strat_chg,
version="ntpd 4.2.2p1@1.1570-o Tue May 19 13:57:55 UTC 2009 (1)",
processor="x86_64", system="Linux/2.6.18-164.el5", leap=00, stratum=4,
precision=-10, rootdelay=0.000, rootdispersion=11.974, peer=59475,
refid=LOCAL(0),
reftime=d495c32c.0e71eaf2 Mon, Jan 7 2013 13:57:00.056, poll=10,
clock=d495c32c.cebd43bd Mon, Jan 7 2013 13:57:00.807, state=4,
offset=0.000, frequency=0.000, jitter=0.977, noise=0.977,
stability=0.000, tai=0