How to Implement Routes Exchange Between Two Routing-Instances on Juniper MX Series Router

How to Implement Routes Exchange Between Two Routing-Instances on Juniper MX Series Router

Also worth noting is that implementing routing between routing-instances using policy-options can only work for instance-type “virtual-router” and doesn’t work for instance-type “vrf”. Instance-type virtual-router in juniper is similar to Cisco’s VRF-lite and is used to create separate routing tables within a single device and provides logical separation of routing instances. On the other hand, Instance-type vrf is primarily used in MPLS/VPN architectures and allows the creation of Virtual Routing and Forwarding (VRF) instances, which are used to isolate customer traffic in a service provider network. Therefore in instance-type vrf, routes are typically exchanged using MP-BGP and controlled by route-targets. The import and export of routes are managed through these route-targets rather than traditional policy statements. That said, here is a procedure to help you implement the routing between the instances effectively and verify the configuration through connectivity tests.

  • InstanceA: Route 10.10.10.0/24 needs to be learned in InstanceB.
  • InstanceB: Route 192.168.0.0/24 needs to be learned in InstanceA.

a) Create Export Policy for InstanceA to InstanceB

set policy-options policy-statement EXPORT_TO_B term 1 from instance Instance_A
set policy-options policy-statement EXPORT_TO_B term 1 from route-filter 10.10.10.0/24 exact
set policy-options policy-statement EXPORT_TO_B term 1 then accept

Comment: This policy exports the route 10.10.10.0/24 from InstanceA to InstanceB.

b) Create Export Policy for InstanceB to InstanceA

set policy-options policy-statement EXPORT_TO_A term 1 from instance Instance_B
set policy-options policy-statement EXPORT_TO_A term 1 from route-filter 192.168.0.0/24 exact
set policy-options policy-statement EXPORT_TO_A term 1 then accept

Comment: This policy exports the route 192.168.0.0/24 from InstanceB to InstanceA.

a) Create Import Policy for InstanceA from InstanceB

set policy-options policy-statement IMPORT_FROM_B term 1 from instance Instance_B
set policy-options policy-statement IMPORT_FROM_B term 1 from route-filter 192.168.0.0/24 exact
set policy-options policy-statement IMPORT_FROM_B term 1 then accept

Comment: This policy imports the route 192.168.0.0/24 from InstanceB into InstanceA.

b) Create Import Policy for InstanceB from InstanceA

set policy-options policy-statement IMPORT_FROM_A term 1 from instance Instance_A
set policy-options policy-statement IMPORT_FROM_A term 1 from route-filter 10.10.10.0/24 exact
set policy-options policy-statement IMPORT_FROM_A term 1 then accept

Comment: This policy imports the route 10.10.10.0/24 from InstanceA into InstanceB.

a) Configure Instance_A

set routing-instances Instance_A routing-options instance-export EXPORT_TO_B
set routing-instances Instance_A routing-options instance-import IMPORT_FROM_B

Comment: This applies the export policy EXPORT_TO_B and the import policy IMPORT_FROM_B to Instance_A.

b) Configure Instance_B

set routing-instances Instance_B routing-options instance-export EXPORT_TO_A
set routing-instances Instance_B routing-options instance-import IMPORT_FROM_A

Comment: This applies the export policy EXPORT_TO_A and the import policy IMPORT_FROM_A to Instance_B.

a) Create Loopback Interface in Instance_A

set routing-instances Instance_A interfaces lo0 unit 10 family inet address 10.10.10.1/32

Comment: This creates a loopback interface lo0.10 with IP 10.10.10.1/32 in Instance_A.

b) Create Loopback Interface in Instance_B

set routing-instances Instance_B interfaces lo0 unit 20 family inet address 192.168.0.1/32

Comment: This creates a loopback interface lo0.20 with IP 192.168.0.1/32 in Instance_B.

a) Verify Routing Tables

show route table Instance_A.inet.0
show route table Instance_B.inet.0

Comment: Ensure that the routes are correctly imported and exported between the instances.

b) Test Connectivity

ping routing-instance Instance_A 192.168.0.1
ping routing-instance Instance_B 10.10.10.1

Comment: Verify that Instance_A can ping the loopback interface lo0.20 in Instance_B and vice versa.


About the Author

Joshua Makuru Nomwesigwa is a seasoned Telecommunications Engineer with vast experience in IP Technologies; he eats, drinks, and dreams IP packets. He is a passionate evangelist of the forth industrial revolution (4IR) a.k.a Industry 4.0 and all the technologies that it brings; 5G, Cloud Computing, BigData, Artificial Intelligence (AI), Machine Learning (ML), Internet of Things (IoT), Quantum Computing, etc. Basically, anything techie because a normal life is boring.

Spread the word: