Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

NTP Configuration

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 span the network can be correlated with 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.

    For example, set an IP address of 172.16.1.1 for your NTP server.

    For example, set a domain name. In this example, the domain name is provided by pool.ntp.org.

  2. Specify the 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.
    For example:
  3. Specify one source address per family for each routing instance.
    For example, the following statement is configured:
  4. (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.

    For example, set an IP address of 172.16.1.1 for your NTP server.

    For example, set a domain name provided by pool.ntp.org.

  5. (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.

    For example:

  6. Verify the configuration.

    Check the system uptime. This command provides the current time, when the device was last booted, when the protocols started, and when the device was last configured.

    Check the NTP server status and associations of the clocking sources used by your device.

    To configure NTP on the router or switch, include the ntp statement at the [edit system] hierarchy level: