The export route-policy command associates the current VPN instance address family with an export Route-Policy.
The undo export route-policy command disassociates the current VPN instance address family from the export Route-Policy.
By default, the current VPN instance address family is not associated with any export Route-Policy.
Parameter | Description | Value |
---|---|---|
policy-name | Specifies the name of the export Route-Policy to be associated with the VPN instance address family. | The name is a string of 1 to 40 case-sensitive characters, with 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, VPN instance IPv6 address family view
Usage Scenario
You can implement a more accurate advertisement of the routes of the VPN instance address family based on the export Route-Policy than that based on the extended community attribute. The export Route-Policy is used to filter the routing information and to set the routing attributes of the routes that pass the filtering.
The export route-policy command advertises local routes of the VPN instance address family to other VPN instances address family. The peer route-policy command or the filter-policy command run in the BGP VPN instance address family view filters routes of the VPN instance address family advertised to or received from CE neighbors.
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.
Prerequisites
The route-distinguisher command has been executed to set the RD of the VPN instance.
Precautions
The current VPN instance address family can be associated with only one export Route-Policy. If the export route-policy command is run several times, the latest configuration overrides the previous configurations.
If the route policy does not exist, you need to configure the route policy.
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.
# Apply an export Route-Policy named poly-1 to the IPv4 address family of the VPN instance named vrf1.
<HUAWEI> system-view [HUAWEI] ip vpn-instance vrf1 [HUAWEI-vpn-instance-vrf1] ipv4-family [HUAWEI-vpn-instance-vrf1-af-ipv4] route-distinguisher 100:1 [HUAWEI-vpn-instance-vrf1-af-ipv4] export route-policy poly-1