peer route-policy (BGP)

Function

The peer route-policy command specifies the route-policy for the routes received from a peer or peer group, or for the routes advertised to the peer or peer group.

The undo peer route-policy command deletes the specified route-policy.

By default, the route-policy is not specified for the peer or peer group.

Format

peer { group-name | ipv4-address | ipv6-address } route-policy route-policy-name { import | export }

peer { group-name | ipv4-address } route-policy route-policy-name export ignore-bit-error

undo peer { group-name | ipv4-address | ipv6-address } route-policy route-policy-name { import | export }

Parameters

Parameter Description Value
group-name Specifies the name of the peer group. The name is a string of 1 to 47 characters without any space. It is case-sensitive.
ipv4-address Specifies the IPv4 address of the peer. It is in dotted decimal notation.
ipv6-address Specifies the IPv6 address of the peer. The address is a 32-digit hexadecimal number in the X:X:X:X:X:X:X:X format.
route-policy-name Specifies the name of a route-policy. The name must be unique and is a string of 1 to 40 characters. It is case-sensitive.
import Applies the route-policy to the routes received from the peer or peer group. -
export Applies the route-policy to the routes advertised to the peer or peer group. -
ignore-bit-error Ignores bit error detection results when applying the route-policy. -
NOTE:
  • ipv4-address is valid only in the BGP view, BGP-IPv4 unicast address family view, BGP-VPN-Target address family view, BGP-IPv6 unicast address family view, BGP-VPNv4 address family view, BGP-VPNv6 address family view, and BGP-VPN instance IPv4 address family view.

  • ipv6-address is valid only in the BGP-IPv6 unicast address family mode and BGP-VPN instance IPv6 address family mode.

Views

BGP view, BGP-IPv4 unicast address family view, BGP-IPv6 unicast address family view, BGP-VPN instance IPv4 address family view, BGP-VPN instance IPv6 address family view, BGP-VPNv4 address family view, BGP-VPNv6 address family view, BGP-VPN-Target address family view, BGP-IPv4 multicast address family view

Only the AntiDDoS8000 series support BGP-VPNv6 address family view.

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The peer route-policy command is used to apply a route-policy to a peer or a peer group so that the routes advertised to or received from the peer or peer group can be controlled. To be specific, only the necessary routes are received from or advertised to the peer or peer group. In this manner, route management is implemented, the scale of the routing table is reduced, and fewer network resources are consumed.

In a bit-error-triggered protection switching scenario, if you want to use the local preference or Multi_Exit Discriminator (MED) attribute specified in the export routing policy no matter whether bit errors occur, run the peer { group-name | ipv4-address } route-policy route-policy-name export ignore-bit-error command.

Prerequisites

The peer as-number command has been used to create a peer or peer group.

Configuration Impact

If the peer route-policy command is run for a peer group, all the members of the peer group inherit the configuration.

If a nonexistent route-policy is specified for a peer or a peer group, the system automatically creates the route policy.

Precautions

At present, using the peer route-policy command to set the preference of BGP on the peers or peer groups is not supported.

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, all routes are advertised to the specified peer, or all routes advertised by the specified peer are accepted.

Example

# Apply the route-policy named test-policy to the routes from IPv4 peers.

<sysname> system-view
[sysname] bgp 100
[sysname-bgp] peer 1.1.1.2 as-number 200
[sysname-bgp] ipv4-family unicast
[sysname-bgp-af-ipv4] peer 1.1.1.2 route-policy test-policy import
# Apply the route-policy named test-policy to the routes from the peer group named test.
<sysname> system-view
[sysname] bgp 100
[sysname-bgp] group test
[sysname-bgp] ipv6-family unicast
[sysname-bgp-af-ipv6] peer test enable
[sysname-bgp-af-ipv6] peer test route-policy test-policy import
Related Topics
route-policy

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