Supported Platforms
Example: Exporting Specific Routes from One Routing Table Into Another Routing Table
This example shows how to duplicate specific routes from one routing table into another routing table within the same routing instance.
Requirements
No special configuration beyond device initialization is required before configuring this example.
Overview
This example uses the auto-export statement and the rib-group statement to accomplish the goal of exporting specific routes from one routing table to another.
Consider the following points:
- When auto-export is configured in a routing instance, the vrf-import and vrf-export policies are examined. Based on the route target and community information in the policies, the auto-export function performs route leaking among the local routing instance inet.0 tables.
- You can use the rib-group statement if it is necessary to import routes into tables other than instance.inet.0. If a RIB group is used, the RIB group's export-rib and import-policy statements are not used. Only the import-rib statement is used. To use a RIB group with auto-export, the routing instance should specify explicit vrf-import and vrf-export policies. The vrf-import and vrf-export policies can be extended to contain additional terms to filter routes as needed for the RIB group.
In this example, access-internal routes are added into the vpna.inet.0 routing table. The access-internal routes are also duplicated into the vpna.inet.2 routing table.
Configuration
CLI Quick Configuration
To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.
Configuring Specific Route Export Between Routing Tables
Step-by-Step Procedure
The following example requires you to navigate various levels in the configuration hierarchy. For instructions on how to do that, see Using the CLI Editor in Configuration Mode in the CLI User Guide.
To configure the device:
- Configure the interfaces.[edit interfaces fe-1/3/1]user@host# set vlan-tagginguser@host# set unit 0 vlan-id 512user@host# set unit 0 family inet address 10.168.100.3/24[edit interfaces lo0 unit 0]user@host# set family inet address 192.168.3.3/32
- Configure the
routing policy that specifies particular routes for import into vpna.inet.0
and export from vpna.inet.0.[edit policy-options policy-statement vpna-export]user@host# set term a from protocol bgpuser@host# set term a then community add vpna-commuser@host# set term a then acceptuser@host# set term b from protocol access-internaluser@host# set term b then acceptuser@host# set term c then reject[edit policy-options policy-statement vpna-import]user@host# set term a from protocol bgpuser@host# set term a from community vpna-commuser@host# set term a then acceptuser@host# set term b from instance vpnauser@host# set term b from protocol access-internaluser@host# set term b then acceptuser@host# set term c then reject[edit policy-options]user@host# set community vpna-comm members target:63000:100
- Configure the routing instance.[edit routing-instances vpna]user@host# set instance-type vrfuser@host# set interface fe-1/3/1.1user@host# set route-distinguisher 100:1user@host# set vrf-import vpna-importuser@host# set vrf-export vpna-export
The vrf-import and vrf-export statements are used to apply the vpna-import and vpna-export routing policies configured in 2.
- Configure the RIB group, and import routes into the vpna.inet.2 routing table.[edit routing-options]user@host# set rib-groups rib-group-vpna-access-internal import-rib vpna.inet.2
- Configure the auto-export statement to enable
the routes to be exported from one routing table into another.[edit routing-options]user@host# set auto-export family inet unicast rib-group rib-group-vpna-access-internal
- Configure BGP.[edit routing-instances vpna protocols bgp group bgp-vpna]user@host# set type externaluser@host# set family inet multicastuser@host# set peer-as 100user@host# set neighbor 100.0.0.10
- Configure the autonomous system (AS) number.[edit routing-options]user@host# set autonomous-system 63000
Results
From configuration mode, confirm your configuration by entering the show interfaces, show policy-options, show routing-options, and show routing-instances commands. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.
If you are done configuring the device, enter commit from configuration mode.
Verification
Confirm that the configuration is working properly by running the show table route vpna.inet.0 and show route table vpna.inet.2 commands.