peer ip-prefix
Function
The peer ip-prefix command configures a route filtering policy based on an IP address prefix list for a peer or peer group.
The undo peer ip-prefix command cancels the route filtering policy based on an IP address prefix list of a peer or peer group.
By default, no route filtering policy based on an IP address prefix list is configured for a peer or peer group.
Format
peer { group-name | ipv4-address } ip-prefix ip-prefix-name { import | export }
peer { group-name | ipv6-address } ipv6-prefix ipv6-prefix-name { import | export }
undo peer { group-name | ipv4-address } ip-prefix [ ip-prefix-name ] { import | export }
undo peer { group-name | ipv6-address } ipv6-prefix [ ipv6-prefix-name ] { import | export }
Parameters
Parameter | Description | Value |
---|---|---|
group-name | Specifies the name of a 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 a peer. | It is in dotted decimal notation. |
ip-prefix-name | specifies the name of an IP address prefix list. | The name is a string of 1 to 169 characters without spaces. It is case-sensitive. |
import | Applies a filtering policy to the routes received from a peer or peer group. | - |
export | Applies a filtering policy to the routes to be advertised to a peer or peer group. | - |
ipv6-address | Specifies the IPv6 address of a peer. | The prefix is a 32-digit hexadecimal number, in the format of X:X:X:X:X:X:X:X. |
ipv6-prefix ipv6-prefix-name | Indicates the filtering policy that is based on the IPv6 prefix list of the peer or peer group. | The name is a string of 1 to 19 characters without spaces. It is case-sensitive. |
ipv4-address is valid only in the BGP view, BGP-IPv4 unicast address family view, BGP-IPv4 multicast address family view.
ipv6-address is valid only in the BGP-IPv6 unicast address family view.
Usage Guidelines
Usage Scenario
The peer ip-prefix command can be used to configure a route filtering policy that is based on an IP prefix list to filter routes received or routes to be advertised, implementing route control.
Prerequisites
Peer relationships have been established using the peer as-number command.
If the peer ip-prefix command specifies an IP prefix list that does not exist for a peer or peer group, use the ip ip-prefix or ip ipv6-prefix command to create an IP prefix list.
Precautions
If an IP prefix list is specified for a peer group, all the members of the peer group inherit the configuration.
After an IP prefix list is specified for a peer or peer group, the peer or peers in the peer group filter the routes to be advertised to or received from other peers based on the IP prefix list. Only the routes that pass the filtering of the IP prefix list can be advertised or received.