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.
peer { group-name | ipv4-address } ip-prefix ip-prefix-name { import | export }
peer { group-name | ipv4-address | 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 | ipv4-address | ipv6-address } ipv6-prefix [ ipv6-prefix-name ] { import | export }
Parameter | Description | Value |
---|---|---|
group-name | Specifies the name of a peer group. | The name is a string of 1 to 47 case-sensitive characters, with spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string. |
ipv4-address | Specifies the IPv4 address of a peer. | It is in dotted decimal notation. |
ip-prefix ip-prefix-name | Indicates the filtering policy that is based on the IPv4 prefix list of the peer or peer group. | The name is a string of 1 to 169 case-sensitive characters, with spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string. |
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 value 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 169 case-sensitive characters, with spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string. |
ipv4-address is valid only in the BGP view, BGP-IPv4 unicast address family view, BGP-IPv4 multicast address family view, BGP-VPN instance IPv4 address family view, BGP-VPNv4 address family view, BGP-IPv6 unicast address family view, and BGP-VPNv6 address family view.
ipv6-address is valid only in the BGP-IPv6 unicast address family view, and BGP-VPN instance IPv6 address family view.
BGP view, BGP-IPv4 unicast address family view, BGP-IPv4 multicast address family view, BGP-VPN instance IPv4 address family view, BGP-VPNv4 address family view, BGP-IPv6 unicast address family view, BGP-VPN instance IPv6 address family view, BGP-VPNv6 address family view
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.
Creating an IP prefix list before it is referenced is recommended. By default, nonexistent IP prefix lists cannot be referenced using the command. If the route-policy nonexistent-config-check disable command is run in the system view and a nonexistent IP prefix list is referenced using the current command, all routes are advertised to the specified peer, or all routes advertised by the specified peer are accepted.