Support Support Downloads Knowledge Base Case Manager My Juniper Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[EX/QFX] Synchronize time with NTP on switch, when the NTP server is reachable through routing-instance

1

0

Article ID: KB30884 KB Last Updated: 14 Feb 2021Version: 3.0
Summary:

This article explains how to synchronize time with NTP on switch, when the NTP server is reachable through routing-instance.

Symptoms:

Goals:

  • Synchronize the time (NTP) on switch, when the NTP server is reachable through routing instance
  • NTP server (99.99.99.99) reachable through routing-instance (VRF-INSTANCE.inet.0)

Topology

[EX4200] Ge-0/0/4(99.99.99.98):RI *VRF*------------- NTP-SERVER (99.99.99.99)

Configuration

  1. NTP configuration:

    set system ntp boot-server 99.99.99.98
    set system ntp server 99.99.99.98
    set system ntp source-address 99.99.99.99 routing-instance VRF-INSTANCE
  2. Configure L3 interfaces

    set interfaces ge-0/0/0 unit 0 family inet address 10.0.0.1/30
    set interfaces ge-0/0/4 unit 0 family inet address 99.99.99.99/24
    set interfaces ge-0/0/10 unit 0 family inet address 20.0.0.1/30
  3. Leaking routes from default instance (inet.0) to routing instance (<instance-name>.inet.0)

    set routing-options interface-routes rib-group inet MASTER->VRF
    set routing-instances VRF-INSTANCE routing-options interface-routes rib-group inet VRF->MASTER
    set routing-options rib-groups VRF->MASTER import-rib VRF-INSTANCE.inet.0
    set routing-options rib-groups VRF->MASTER import-rib inet.0
    set routing-options rib-groups MASTER->VRF import-rib inet.0
    set routing-options rib-groups MASTER->VRF import-rib VRF-INSTANCE.inet.0
  4. Defining the VRF-INSTANCE Routing instance:

    set routing-instances VRF-INSTANCE instance-type vrf
    set routing-instances VRF-INSTANCE interface ge-0/0/4.0
    set routing-instances VRF-INSTANCE route-distinguisher 11:11
    set routing-instances VRF-INSTANCE vrf-target target:11:11
Solution:
{master:0}[edit]
root@EX4200# run show version 
fpc0:
--------------------------------------------------------------------------
Hostname: EX4200
Model: ex4200-48p
JUNOS Base OS boot [12.3R11.2]
JUNOS Base OS Software Suite [12.3R11.2]
JUNOS Kernel Software Suite [12.3R11.2]
JUNOS Crypto Software Suite [12.3R11.2]
JUNOS Online Documentation [12.3R11.2]
JUNOS Enterprise Software Suite [12.3R11.2]
JUNOS Packet Forwarding Engine Enterprise Software Suite [12.3R11.2]
JUNOS Routing Software Suite [12.3R11.2]
JUNOS Web Management [12.3R11.2]
JUNOS FIPS mode utilities [12.3R11.2]

{master:0}[edit]
root@EX4200# run show system uptime 
fpc0:
--------------------------------------------------------------------------
Current time: 2016-04-22 10:31:40 UTC
System booted: 2016-04-22 08:33:11 UTC (01:58:29 ago)
Protocols started: 2016-04-22 08:35:25 UTC (01:56:15 ago)
Last configured: 2015-12-12 12:16:10 UTC (18w5d 22:15 ago) by root
10:31AM  up 1:58, 1 user, load averages: 0.02, 0.07, 0.07

{master:0}[edit]
root@EX4200# show system ntp 
boot-server 99.99.99.98;
server 99.99.99.98;
source-address 99.99.99.99 routing-instance VRF;

{master:0}[edit]
root@EX4200# show routing-instances 
VRF {
    instance-type vrf;
    interface ge-0/0/4.0;
    route-distinguisher 11:11;
    vrf-target target:11:11;
    routing-options {
        interface-routes {
            rib-group inet VRF->MASTER;
        }
    }
}

{master:0}[edit]
root@EX4200# show routing-options 
interface-routes {
    rib-group inet MASTER-VRF;
}
rib-groups {
    VRF->MASTER {
        import-rib [ VRF.inet.0 inet.0 ];
    }
    MASTER-VRF {
        import-rib [ inet.0 VRF.inet.0 ];
    }
}


{master:0}[edit]
root@EX4200# run show interfaces terse | match in 
Interface               Admin Link Proto    Local                 Remote
ge-0/0/0.0              up    up   inet     10.0.0.1/30     
ge-0/0/4.0              up    up   inet     99.99.99.99/24  
ge-0/0/10.0             up    up   inet     20.0.0.1/30     
bme0.32768              up    up   inet     128.0.0.1/2     
lo0.16384               up    up   inet     127.0.0.1           --> 0/0

{master:0}[edit]
root@EX4200# run show ntp status 
status=06e4 leap_none, sync_ntp, 14 events, event_peer/strat_chg,
version="ntpd 4.2.0-a Thu Sep 24 12:49:59 UTC 2015 (1)",
processor="powerpc", system="JUNOS12.3R11.2", leap=00, stratum=5,
precision=-18, rootdelay=96.126, rootdispersion=218.544, peer=38220,
refid=99.99.99.98,
reftime=dac47be2.6b0f418d  Fri, Apr 22 2016 10:30:58.418, poll=6,
clock=dac47c24.655b4814  Fri, Apr 22 2016 10:32:04.395, state=4,
offset=-109.841, frequency=125.585, jitter=28.518, stability=105.175

{master:0}[edit]
root@EX4200# run show ntp associations 
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*99.99.99.98     80.80.83.32      4 -    3   16  377    1.140  -249.95  23.599

{master:0}[edit]
root@EX4200# run show route | no-more 

inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

10.0.0.0/30        *[Direct/0] 01:56:32
                    > via ge-0/0/0.0
10.0.0.1/32        *[Local/0] 01:56:42
                      Local via ge-0/0/0.0
20.0.0.0/30        *[Direct/0] 01:56:33
                    > via ge-0/0/10.0
20.0.0.1/32        *[Local/0] 01:56:41
                      Local via ge-0/0/10.0
99.99.99.0/24      *[Direct/0] 01:56:34
                    > via ge-0/0/4.0
99.99.99.99/32     *[Local/0] 01:56:34
                      Local via ge-0/0/4.0
224.0.0.22/32      *[IGMP/0] 01:56:46
                      MultiRecv

VRF-INSTANCE.inet.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

10.0.0.0/30        *[Direct/0] 01:56:32
                    > via ge-0/0/0.0
10.0.0.1/32        *[Local/0] 01:56:32
                      Local via ge-0/0/0.0
20.0.0.0/30        *[Direct/0] 01:56:33
                    > via ge-0/0/10.0
20.0.0.1/32        *[Local/0] 01:56:33
                      Local via ge-0/0/10.0
99.99.99.0/24      *[Direct/0] 01:56:34
                    > via ge-0/0/4.0
99.99.99.99/32     *[Local/0] 01:56:41
                      Local via ge-0/0/4.0

{master:0}[edit]
root@EX4200# delete system ntp 

{master:0}[edit]
root@EX4200# commit 
configuration check succeeds

root@EX4200# run set date ?
Possible completions:
  <time>               New date and time (YYYYMMDDhhmm.ss)
  ntp                  Set system date and time using Network Time Protocol servers
{master:0}[edit]
root@EX4200# run set date 201512121212.12 
Sat Dec 12 12:12:12 UTC 2015

{master:0}[edit]
root@EX4200# run show system uptime 
fpc0:
--------------------------------------------------------------------------
Current time: 2015-12-12 12:12:15 UTC
System booted: 2015-12-12 10:10:10 UTC (02:02:05 ago)
Protocols started: 2015-12-12 10:12:24 UTC (01:59:51 ago)
Last configured: 2016-04-22 10:35:01 UTC (-22:-22:-46 ago) by root
12:12PM  up 2:02, 1 user, load averages: 0.07, 0.05, 0.06

{master:0}[edit]
root@EX4200# rollback 1 
load complete

{master:0}[edit]
root@EX4200# show | compare 
[edit system]
+   ntp {
+       boot-server 99.99.99.98;
+       server 99.99.99.98;
+       source-address 99.99.99.99 routing-instance VRF-INSTANCE;
+   }

{master:0}[edit]
root@EX4200# commit 
configuration check succeeds
commit complete

{master:0}[edit]
root@EX4200# run start shell 
root@EX4200:RE:0% date
Fri Apr 22 10:35:41 UTC 2016	<<<<----
root@EX4200:RE:0% exit
exit

{master:0}[edit]
root@EX4200# run show system uptime 
fpc0:
--------------------------------------------------------------------------
Current time: 2016-04-22 10:35:48 UTC       <<<<----
System booted: 2016-04-22 08:33:11 UTC (02:02:37 ago)	
Protocols started: 2016-04-22 08:35:26 UTC (02:00:22 ago)
Last configured: 2015-12-12 12:12:27 UTC (18w5d 22:23 ago) by root
10:35AM  up 2:03, 1 user, load averages: 0.10, 0.06, 0.06

{master:0}[edit]
root@EX4200# run show ntp status    
status=0664 leap_none, sync_ntp, 6 events, event_peer/strat_chg,	<<<<----
version="ntpd 4.2.0-a Thu Sep 24 12:49:59 UTC 2015 (1)",
processor="powerpc", system="JUNOS12.3R11.2", leap=00, stratum=5,
precision=-18, rootdelay=95.932, rootdispersion=490.130, peer=50324,
refid=99.99.99.98,
reftime=dac47d42.7ab9df0d  Fri, Apr 22 2016 10:36:50.479, poll=6,
clock=dac47d53.a0fc5f83  Fri, Apr 22 2016 10:37:07.628, state=4,
offset=0.074, frequency=-93.191, jitter=0.247, stability=0.000

{master:0}[edit]
root@EX4200# run show ntp associations    
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*99.99.99.98     80.80.83.32      4 -   14   16    1    0.946    0.074   0.374

Modification History:

2021-02-14: Removed unwanted configuration.

Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search