The import route-policy command associates the current VPN instance address family with an import Route-Policy.
The undo import route-policy command disassociates the current VPN instance address family from an import Route-Policy.
By default, the current VPN instance address family is not associated with any import Route-Policy.
Parameter | Description | Value |
---|---|---|
policy-name | Specifies the name of the import 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, or VPN instance IPv6 address family view
Usage Scenario
When no import Route-Policy is configured, routes that match the export VPN target attribute of the received routes and the import VPN target attribute of the local VPN instance address family are added to the VPN instance address family. To control the import of the routes into the VPN instance address family more accurately, you can use the import Route-Policy. The import Route-Policy is used to filter the imported routing information and to set the routing attributes of the routes that pass the filtering.
The import route-policy command controls the VPN routes that are cross added to the VPN instance 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.
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 import Route-Policy. If the import route-policy command is run several times, the latest configuration overrides the previous configurations.
If the route policy to be associated with the VPN instance address family 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 VPNv4 address family can be crossed to the VPN instance 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 VPNv6 address family can be crossed to the VPN instance address family.
# Apply an import 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] import route-policy poly-1