This article provides information on how to synchronize the time between the NTP server and NTP client, which are on different networks, via the routing-instance on EX-series switches. In this scenario, Switch 2 is acting as the NTP client, which is syncing time with the NTP server that is connected to switch 1.
Configuration:
Switch 1:
Switch 1 is configured to sync time with the NTP server at
10.130.35.159.
NTP configuration:
set system ntp server 10.130.35.159 version 4
set system ntp server 10.130.35.159 prefer
set system ntp source-address 10.130.35.150
Defining the R1 Routing instance:
set routing-instances R1 instance-type virtual-router
set routing-instances R1 interface ge-0/0/2.0
Defining the policy options:
The
p1 policy is defined to accept routes from the R1 instance:
set policy-options policy-statement p1 from instance R1
set policy-options policy-statement p1 then accept
The
p2 policy is defined to accept the
10.130.35.150/32 route from the master instance:
set policy-options policy-statement p2 from instance master
set policy-options policy-statement p2 from route-filter 10.130.35.150/32 exact
set policy-options policy-statement p2 then accept
Importing the R1 routing instance into the master routing table:
set routing-options instance-import p1
Importing the 10.130.35.150/32 network from the master routing table to the R1 routing-instance:
set routing-instances R1 routing-options instance-import p2
Switch2:
NTP configuration:
set system ntp server 10.130.35.150 prefer
Defining the route to 10.130.35.150:
set routing-options static route 10.130.35.150/32 next-hop 100.100.100.2
The following command is issued to verify the NTP associations:
Switch 1:
user@switch> show ntp associations
remote refid st t when poll reach delay offset jitter
==============================================================================
*10.130.35.159 80.80.83.32 2 - 38 16 377 1.102 11.298 18.420
Switch 2:
user@switch>show ntp associations
remote refid st t when poll reach delay offset jitter
==============================================================================
*10.130.35.150 10.130.35.159 3 - 20 64 377 1.688 -0.611 2.147