import route-policy

Function

The import route-policy command associates a VPN instance enabled with the IPv4 or IPv6 address family with an import routing policy. Only one import routing policy can be associated with a VPN instance enabled with the IPv4 or IPv6 address family. If the import route-policy command is run more than once, the latest configuration overrides the previous ones.

The undo import route-policy command dissociates a VPN instance enabled with the IPv4 or IPv6 address family from an import routing policy.

By default, no import routing policy is associated with a VPN instance enabled with the IPv4 or IPv6 address family.

Format

import route-policy policy-name

undo import route-policy

Parameters

Parameter Description Value
policy-name

Specifies the name of an import routing policy to be associated with a VPN instance enabled with the IPv4 or IPv6address 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.

Views

VPN instance view, VPN instance IPv4 address family view, or VPN instance IPv6 address family view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

If a routing policy needs to be used to control route import for a VPN instance in BGP/MPLS IP VPN networking, the import route-policy command can be used. After the import route-policy command is run for a VPN instance, the VPN instance will filter VPNv4 or VPNv6 routes to be added to the routing table of the VPN instance and add route attributes to the routes that pass the filtering.

The import route-policy command can be used to control route import between different VPN instances on a PE. This is different from the peer route-policy import command, which can only be used to control the VPNv4 or VPNv6 routes received by a PE from another PE.

Pre-configuration Tasks

The route-distinguisher command is run to configure an RD (Route Distinguisher) for the VPN instance enabled with the IPv4 or IPv6 address family.

Configuration Impact

After the import 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 import 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 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.

Example

# Apply the routing policy named policy-1 on received routes to the IPv4 address family of the VPN instance named vrf1.

<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] import route-policy policy-1
Related Topics
export route-policy (VPN instance IPv4 address family view)
peer route-policy (BGP)
route-distinguisher
route-policy

Huawei Proprietary and Confidential
Copyright © Huawei Technologies Co., Ltd.