peer route-limit

Use peer route-limit to set the maximum number of routes that can be received from a peer or peer group.

Use undo peer route-limit to remove the configuration.

Syntax

In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view/BGP IPv4 multicast address family view:

peer { group-name | ipv4-address [ mask-length ] } route-limit prefix-number [ { alert-only | discard | reconnect reconnect-time } | percentage-value ] *

undo peer { group-name | ipv4-address [ mask-length ] } route-limit

In BGP IPv6 unicast address family view:

peer { group-name | ipv6-address [ prefix-length ] } route-limit prefix-number [ { alert-only | discard | reconnect reconnect-time } | percentage-value ] *

undo peer { group-name | ipv6-address [ prefix-length ] } route-limit

In BGP-VPN IPv6 unicast address family view/BGP IPv6 multicast address family view:

peer { group-name | ipv6-address [ prefix-length ] } route-limit prefix-number [ { alert-only | discard | reconnect reconnect-time } | percentage-value ] *

undo peer { group-name | ipv6-address [ prefix-length ] } route-limit

Default

The number of routes that can be received from a peer or peer group is not limited.

Views

BGP IPv4 unicast address family view

BGP-VPN IPv4 unicast address family view

BGP IPv6 unicast address family view

BGP-VPN IPv6 unicast address family view

BGP IPv4 multicast address family view

BGP IPv6 multicast address family view

Predefined user roles

network-admin

Parameters

group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.

ipv4-address: Specifies a peer by its IPv4 address. The peer must have been created.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ipv4-address and mask-length arguments together to specify a subnet. If you specify a subnet, this command specifies the maximum number of routes that can be received from all dynamic peers in the subnet.

ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a subnet. If you specify a subnet, this command specifies the maximum number of routes that can be received from all dynamic peers in the subnet.

prefix-number: Specifies the number of routes that can be received from the peer or peer group. Its value range is 1 to 4294967295. The router will tear down the session to the peer or peer group if the following conditions exist:

The router will not attempt to re-establish the session to a dynamic BGP peer until the router receives a connection request from the peer. For other peers, you can use the reset bgp command to re-establish the sessions.

alert-only: If the number of routes received from the peer or peer group reaches the prefix-number, the router generates a log message instead of tearing down the session to the peer or peer group. The router can continue to receive routes from the peer or peer group.

discard: If the number of routes received from the peer or peer group reaches the prefix-number, the router retains the session to the peer or peer group. However, it discards excess routes and generates a log message. After the number of routes received from the peer or peer group falls below the prefix-number, the router can continue to receive routes from the peer or peer group. To restore the discarded routes, use the refresh bgp import command to request the peer or peer group to resend the routes.

reconnect reconnect-time: Specifies a reconnect time. After the specified time is reached, the router re-establishes a session to the peer or peer group when the number of routes received from the peer or peer group reaches the prefix-number. The value range for the reconnect-time argument is 1 to 65535 seconds. This option is not available for dynamic BGP peers.

percentage-value: Specifies the threshold value for the router to generate a log message (the router generates a log message when the ratio of the number of received routes to the prefix-number exceeds the percentage value). The value range of this argument is 1 to 100, and the default is 75.

Examples

# In BGP IPv4 unicast address family view, set the maximum number of routes that can be received from peer 1.1.1.1 to 10000. Configure the router to tear down the session to the peer if the number is exceeded.

<Sysname> system-view
[Sysname] bgp 109
[Sysname-bgp-default] address-family ipv4 unicast
[Sysname-bgp-default-ipv4] peer 1.1.1.1 route-limit 10000