Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Configuring NTP

    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.

      [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, when the protocols started, and when the device was last configured.

      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.

           remote           refid      st t when poll reach   delay   offset  jitter
      ==============================================================================
       tux.brhelwig.co .INIT.          16 -    -  512    0    0.000    0.000 4000.00
      

      user@host > show ntp status
      status=c011 sync_alarm, sync_unspec, 1 event, event_restart,
      version="ntpd 4.2.0-a Thu May 30 19:14:15 UTC 2013 (1)",
      processor="i386", system="JUNOS13.2-20130530_ib_13_3_psd.1", leap=11,
      stratum=16, precision=-18, rootdelay=0.000, rootdispersion=5.130,
      peer=0, refid=INIT,
      reftime=00000000.00000000  Wed, Feb  6 2036 22:28:16.000, poll=4,
      clock=d59d4f2e.1793bce9  Fri, Jul 26 2013 12:40:30.092, state=1,
      offset=0.000, frequency=62.303, jitter=0.004, stability=0.000

    Modified: 2013-12-10