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.
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
set routing-instances R1 instance-type virtual-router set routing-instances R1 interface ge-0/0/2.0
set policy-options policy-statement p1 from instance R1 set policy-options policy-statement p1 then accept
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
set routing-options instance-import p1
set routing-instances R1 routing-options instance-import p2
set system ntp server 10.130.35.150 prefer
set routing-options static route 10.130.35.150/32 next-hop 100.100.100.2
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
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
2021-03-25: Updated the article terminology to align with Juniper's Inclusion & Diversity initiatives.