The export route-policy command associates a VPN instance enabled with the IPv4 or IPv6 address family with an export routing policy. Only one export routing policy can be associated with a VPN instance enabled with the IPv4 or IPv6 address family. If the export route-policy command is run more than once, the latest configuration overrides the previous ones.
The undo export route-policy command dissociates a VPN instance enabled with the IPv4 or IPv6 address family from an export routing policy.
By default, no export routing policy is associated with a VPN instance enabled with the IPv4 or IPv6 address family.
| Parameter | Description | Value |
|---|---|---|
| policy-name | Specifies the name of an export routing policy to be associated with a VPN instance enabled with the IPv4 or IPv6 address family. |
The value is a string of 1 to 40 case-sensitive characters, spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string. |
VPN instance view, VPN instance IPv4 address family view, or VPN instance IPv6 address family view
Usage Scenario
If a routing policy needs to be used to control route transmission for a VPN instance in BGP/MPLS IP VPN networking, the export route-policy command can be used. After the export route-policy command is run for a VPN instance, the VPN instance will filter routes to be advertised and add route attributes to the routes that pass the filtering.
The export route-policy command can be used to control route transmission between different VPN instances on a PE. This is different from the peer route-policy export command, which can only be used to control the sending of VPNv4 or VPNv6 routes from a PE to another PE.
In local cross scenarios, you can run the export route-policy command to filter out locally crossed routes and set the attributes of these routes. Locally crossed routes include both locally imported routes and routes learned from VPN peers.
Pre-configuration Tasks
The route-distinguisher command is run to configure an RD for the VPN instance enabled with the IPv4 or IPv6 address family.
Configuration Impact
After the export route-policy command is run, route attributes will be added to the VPN routes that pass the filtering, and the VPN routes that fail the filtering will be discarded.
Follow-up Procedure
If the routing policy specified in the export route-policy command does not exist, you need to configure the routing policy by using the route-policy command.
Precautions
Creating a route-policy before it is referenced is recommended. By default, nonexistent route-policies cannot be referenced using the command. If the route-policy nonexistent-config-check disable command is run in the system view and a nonexistent route-policy is referenced using the current command in the VPN instance view or BGP-VPN instance IPv4 address family view, all routes in the VPN instance address family can be crossed to the VPNv4 address family. If the route-policy nonexistent-config-check disable command is run in the system view and a nonexistent route-policy is referenced using the current command in the BGP-VPN instance IPv6 address family view, all routes in the BGP-VPN instance IPv6 address family can be crossed to the VPNv6 address family.
# Associate the IPv4 address family of the VPN instance vrf1 with the routing policy "poly-1".
<sysname> system-view
[sysname] ip vpn-instance vrf1
[sysname-vpn-instance-vrf1] ipv4-family
[sysname-vpn-instance-vrf1-af-ipv4] route-distinguisher 100:1
[sysname-vpn-instance-vrf1-af-ipv4] export route-policy poly-1