Related Documentation
- ACX, M, MX, PTX, QFX, SRX, T Series
- auto-export
- J, M, MX, SRX, T Series
- Auto Export Feature Overview
- M, PTX, T Series
- Defining BGP Communities and Extended Communities for Use in Routing Policy Match Conditions
Example: Configuring and Verifying the Auto Export Feature
This example shows how to configure the Auto Export feature.
Requirements
This example uses the following hardware and software components:
- Junos OS Release 7.3 or later
- Two Juniper Networks SRX Series Services Gateways, J Series Services Routers, M Series Multiservice Edge Routers, MX Series 3D Universal Edge Routers, or T Series Core Routers
Overview and Topology
The Auto Export feature must be applied on the local PE router, in this example, Router PE2. The local VRF routing instances are configured on Router PE2. The resulting routing entries are based on the applied vrf-import and vrf-export policies.
In this example configuration:
- The Common Services and Management VRF routing instances are attached only to the local PE router, Router PE2.
- The Customer 2 VRF routing instance acts as the control VRF routing instance to illustrate the effect of the auto-export statement on any VRF routing instance that does not use custom policies.
Table 1 shows the VRF routing instances and address spaces that are used in this example.
Table 1: VRF Address Mapping
VRF Name | VRF Notation | Assigned Address Space |
---|---|---|
Common Services | cs-vrf | target: 65000:50 – 10.50.0.0 |
Management | mgmt-vrf | target: 65000:60 – 10.60.0.0 |
Customer 1 | cust-vrf | target: 65000:70 – 10.70.0.0 |
Customer 2 | cust2-vrf | target: 65000:80 – 10.80.0.0 |
The topology of the network is shown in Figure 1.
Figure 1: Layer 3 VPN Example for Demonstrating the Auto Export Feature

Configuration
To configure the Auto Export feature, perform these tasks:
- Configuring VRF Routing Instances on the Local PE Router (PE2)
- Configuring VRF Routing Instances on the Remote PE Router (PE1)
- Before Configuring Auto Export
- Configuring Auto Export
Configuring VRF Routing Instances on the Local PE Router (PE2)
Step-by-Step Procedure
To configure the VRF routing instances on Router PE2:
- Configure the Common Services VRF routing instance (cs-vrf) and assign it to the 10.50.1.0/24 network.[edit routing-instances]user@PE2# set cs-vrf instance-type vrfuser@PE2# set cs-vrf interface ge-0/0/0.50user@PE2# set cs-vrf route-distinguisher 10.3.3.3:50user@PE2# set cs-vrf vrf-target target:65000:50user@PE2# set cs-vrf vrf-table-label
- Configure the Customer 1 VRF routing instance (cust-vrf) and assign it to the 10.70.1.0/24 network. [edit routing-instances]user@PE2# set cust-vrf instance-type vrfuser@PE2# set cust-vrf interface ge-0/0/0.70user@PE2# set cust-vrf route-distinguisher 10.3.3.3:70user@PE2# set cust-vrf vrf-import cust-vrf-importuser@PE2# set cust-vrf vrf-export cust-vrf-exportuser@PE2# set cust-vrf vrf-table-label
- Configure the Customer 2 VRF routing instance (cust2-vrf) and assign it to the 10.80.1.0/24 network.[edit routing-instances]user@PE2# set cust2-vrf instance-type vrfuser@PE2# set cust2-vrf interface ge-0/0/0.80user@PE2# set cust2-vrf route-distinguisher 10.3.3.3:80user@PE2# set cust2-vrf vrf-target target:65000:80user@PE2# set cust2-vrf vrf-table-label
- Configure the Management VRF routing instance (mgmt-vrf) and assign it to the 10.60.1.0/24 network. [edit routing-instances]user@PE2# set mgmt-vrf instance-type vrfuser@PE2# set mgmt-vrf interface ge-0/0/0.60user@PE2# set mgmt-vrf route-distinguisher 10.3.3.3:60user@PE2# set mgmt-vrf vrf-target target:65000:60user@PE2# set mgmt-vrf vrf-table-label
- Configure the export policy (cust-vrf-export).
The cust-vrf-export policy exports routes to the remote router (PE1). The export policy is inherited when the Auto Export feature is applied on the router.
[edit policy-options]user@PE2# set policy-statement cust-vrf-export term 1 from protocol directuser@PE2# set policy-statement cust-vrf-export term 1 then community add cust-vrf-commuser@PE2# set policy-statement cust-vrf-export term 1 then accept - Configure the import policy (cust-vrf-import).
The cust-vrf-import policy imports remote routes (on Router PE1) by using BGP extended community attributes.
[edit policy-options]user@PE2# set policy-statement cust-vrf-import term 1 from community [ cs-vrf-comm mgmt-vrf-comm cust-vrf-comm ]user@PE2# set policy-statement cust-vrf-import term 1 then acceptuser@PE2# set policy-statement cust-vrf-import term default then reject - Configure the VRF routing instance communities.[edit policy-options]user@PE2# set community cs-vrf-comm members target:65000:50user@PE2# set community cust-vrf-comm members target:65000:70user@PE2# set community cust2-vrf-comm members target:65000:80user@PE2# set community mgmt-vrf-comm members target:65000:60
Configuring VRF Routing Instances on the Remote PE Router (PE1)
Step-by-Step Procedure
To configure the VRF routing instances on Router PE1:
- Configure the Customer 1 VRF routing instance (cust-vrf) and assign it to the 10.70.2.0/24 network.[edit routing-instances]user@PE1# set cust-vrf instance-type vrfuser@PE1# set cust-vrf interface ge-0/0/0.70user@PE1# set cust-vrf route-distinguisher 10.2.2.2:70user@PE1# set cust-vrf vrf-import cust-vrf-importuser@PE1# set cust-vrf vrf-export cust-vrf-exportuser@PE1# set cust-vrf vrf-table-label
- Configure the Customer 2 VRF routing instance (cust2-vrf) and assign it to the 10.80.2.0/24 network.
The Customer 2 VRF routing instance uses the vrf-target statement to eliminate having to apply a custom policy.
[edit routing-instances]user@PE1# set cust2-vrf instance-type vrfuser@PE1# set cust2-vrf interface ge-0/0/0.80user@PE1# set cust2-vrf route-distinguisher 10.2.2.2:80user@PE1# set cust2-vrf vrf-target target:65000:80user@PE1# set cust2-vrf vrf-table-label - Configure the export policy (cust-vrf-export).
The cust-vrf-export policy exports routes to the remote router (Router PE2) by using BGP extended community attributes.
[edit policy-options]user@PE1# set policy-statement cust-vrf-export term 1 from protocol directuser@PE1# set policy-statement cust-vrf-export term 1 then community add cust-vrf-commuser@PE1# set policy-statement cust-vrf-export term 1 then accept - Configure the import policy (cust-vrf-import).
The cust-vrf-import policy imports remote routes (from Router PE2) by using BGP extended community attributes.
[edit policy-options]user@PE1# set policy-statement cust-vrf-import term 1 from community [ cs-vrf-comm mgmt-vrf-comm cust-vrf-comm ]user@PE1# set policy-statement cust-vrf-import term 1 then acceptuser@PE1# set policy-statement cust-vrf-import term default then reject - Configure the VRF routing instance communities.[edit policy-options]user@PE1# set community cs-vrf-comm members target:65000:50user@PE1# set community cust-vrf-comm members target:65000:70user@PE1# set community cust2-vrf-comm members target:65000:80user@PE1# set community mgmt-vrf-comm members target:65000:60
Results
Before Configuring Auto Export
Step-by-Step Procedure
Prior to enabling the Auto Export feature on Router PE2, Router PE1 has the Common Services and Management VRF VPN prefixes in the Customer 1 VRF routing tables and Router PE2 does not.
To verify that Router PE1 has the Common Services and Management VRF VPN prefixes in the Customer 1 VRF routing tables and Router PE2 does not:
- On Router PE2, display the routing table for the cust-vrf routing instance by using the show route
table cust-vrf.inet.0 command.
Notice that only the Customer 1 routes are in the routing table. No prefix leaking has taken place.
user@PE2> show route table cust-vrf.inet.0
cust-vrf.inet.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.70.1.0/24 *[BGP/170] 00:04:22, localpref 100, from 10.2.2.2 AS path: I > to 172.16.2.1 via ge-0/0/0.0, Push 16 10.70.2.0/24 *[Direct/0] 00:56:37 > via ge-0/0/0.70 10.70.2.1/32 *[Local/0] 00:56:37 Local via ge-0/0/0.70
- On Router PE1, display the routing table for the cust-vrf routing instance by using the show route
table cust-vrf.inet.0 command.
Notice that Common Services and Management VRF prefixes have leaked into the routing table.
user@PE1> show route table cust-vrf.inet.0
cust-vrf.inet.0: 5 destinations, 5 routes (5 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.50.2.0/24 *[BGP/170] 00:11:11, localpref 100, from 10.3.3.3 AS path: I > to 172.16.2.2 via ge-0/0/0.0, Push 16 10.60.2.0/24 *[BGP/170] 00:11:11, localpref 100, from 10.3.3.3 AS path: I > to 172.16.2.2 via ge-0/0/0.0, Push 19 10.70.1.0/24 *[Direct/0] 00:54:22 > via ge-0/0/0.70 10.70.1.1/32 *[Local/0] 00:54:22 Local via ge-0/0/0.70 10.70.2.0/24 *[BGP/170] 00:11:11, localpref 100, from 10.3.3.3 AS path: I > to 172.16.2.2 via ge-0/0/0.0, Push 17
The Common Services (cs-vrf) route prefixes and the Management (mgmt-vrf) route prefixes have leaked into the Customer 1 VRF routing table because the custom policy (cust-vrf-import) is applied on Router PE1. This leaking of prefixes has not taken place on Router PE2.
Results
This indicates that prefix leaking takes place on remote PE routers and not on local PE routers. The Auto Export feature enables local prefix leaking.
Configuring Auto Export
Step-by-Step Procedure
To configure the Auto Export feature on Router PE2:
- Apply Auto Export to the Common Services VRF.[edit routing-instances]user@PE2# set cs-vrf routing-options auto-export
- Apply Auto Export to the Customer 1 VRF.[edit routing-instances]user@PE2# set cust-vrf routing-options auto-export
- Apply Auto Export to the Customer 2 VRF.[edit routing-instances]user@PE2# set cust2-vrf routing-options auto-export
- Apply Auto Export to the Management VRF.[edit routing-instances]user@PE2# set mgmt-vrf routing-options auto-export
Results
The Auto Export feature is now applied to the local PE router, which causes the local VRF route prefixes to leak into the local customer VRF.
Verification
Verifying Route Leaking
Purpose
To verify that the Auto Export feature enables automatic leaking of route prefixes between locally configured VRF routing instances on a PE router.
Action
Verify the Auto Export feature by viewing the Customer 1 VRF routes on Routers PE2 and PE1.
To confirm that the configuration is working properly:
- On Router PE2, display the routing table for the cust-vrf routing instance by using the show route
table cust-vrf.inet.0 statement.
user@PE2> show route table cust-vrf.inet.0
cust-vrf.inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.50.2.0/24 *[Direct/0] 00:00:06 > via ge-0/0/0.50 10.50.2.1/32 *[Local/0] 00:00:06 Local via ge-0/0/0.50 10.60.2.0/24 *[Direct/0] 00:00:06 > via ge-0/0/0.60 10.60.2.1/32 *[Local/0] 00:00:06 Local via ge-0/0/0.60 10.70.1.0/24 *[BGP/170] 00:00:06, localpref 100, from 10.2.2.2 AS path: I > to 172.16.2.1 via ge-0/0/0.0, Push 16 10.70.2.0/24 *[Direct/0] 01:16:47 > via ge-0/0/0.70 10.70.2.1/32 *[Local/0] 01:16:47 Local via ge-0/0/0.70
The lines of output that start with 10.50.2.0/24 and 10.50.2.1/32 show that Common Services route prefixes have leaked into the Customer 1 VRF routing table. The lines of output that start with 10.60.2.0/24 and 10.60.2.1/32 show that Management route prefixes have leaked into the Customer 1 VRF routing table.
- On Router PE1, display the routing table for the cust-vrf routing instance by using the show route
table cust-vrf.inet.0 statement.
user@PE1> show route table cust-vrf.inet.0
cust-vrf.inet.0: 5 destinations, 5 routes (5 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.50.2.0/24 *[BGP/170] 00:11:11, localpref 100, from 10.3.3.3 AS path: I > to 172.16.2.2 via ge-0/0/0.0, Push 16 10.60.2.0/24 *[BGP/170] 00:11:11, localpref 100, from 10.3.3.3 AS path: I > to 172.16.2.2 via ge-0/0/0.0, Push 19 10.70.1.0/24 *[Direct/0] 00:54:22 > via ge-0/0/0.70 10.70.1.1/32 *[Local/0] 00:54:22 Local via ge-0/0/0.70 10.70.2.0/24 *[BGP/170] 00:11:11, localpref 100, from 10.3.3.3 AS path: I > to 172.16.2.2 via ge-0/0/0.0, Push 17
The Customer 1 VRF routing table entries on Router PE1 are unchanged.
Meaning
On applying the Auto Export feature on Router PE2, the Common Services and Management VRF prefixes are copied into the Customer 1 VRF routing table on Router PE2. The Customer 1 VRF routing table entries on Router PE1 are unchanged.
Thus, the Auto Export feature helps local prefix leaking.
Related Documentation
- ACX, M, MX, PTX, QFX, SRX, T Series
- auto-export
- J, M, MX, SRX, T Series
- Auto Export Feature Overview
- M, PTX, T Series
- Defining BGP Communities and Extended Communities for Use in Routing Policy Match Conditions
Published: 2013-02-08
Related Documentation
- ACX, M, MX, PTX, QFX, SRX, T Series
- auto-export
- J, M, MX, SRX, T Series
- Auto Export Feature Overview
- M, PTX, T Series
- Defining BGP Communities and Extended Communities for Use in Routing Policy Match Conditions