If the device imports a large number of routes, system performance may be affected when services are being processed because the routes consume a lot of system resources. To improve system reliability, configure a limit on the number of public route prefixes. When the number of public route prefixes exceeds the limit, an alarm is generated, prompting you to check validity of public route prefixes.
Configure a limit on the number of public route prefixes.
Run system-view
The system view is displayed.
Run ip prefix-limit number { alert-percent [ route-unchanged ] | simply-alert }
A limit on the number of IPv4 public route prefixes is configured.
By default, the maximum number of IPv4 public route prefixes is not limited.
Run ipv6 prefix-limit number { alert-percent [ route-unchanged ] | simply-alert }
A limit on the number of IPv6 public route prefixes is configured.
By default, the maximum number of IPv6 public route prefixes is not limited.
alert-percent specifies the percentage of the maximum number of supported public route prefixes. If you specify alert-percent in the command, an alarm is generated when the number of public route prefixes exceeds the value calculated by the following formula:
(number x alert-percent)/100
New public route prefixes can still be added to the IP routing table until the number of public route prefixes reaches the value of number. Subsequent route prefixes will then be discarded.
If you specify simply-alert in the command, new public route prefixes can still be added to the IP routing table and only an alarm is generated after the number of public route prefixes exceeds the value of number. However, when the total number of private and public route prefixes reaches the limit on the number of unicast route prefixes specified in the PAF file, subsequent public route prefixes will be discarded.
If it is specified, the IP routing table remains unchanged.
If it is not specified, the system deletes all the routes from the IP routing table and re-adds routes to the IP routing table.
(Optional) Run ip prefix-limit log-interval interval
An interval at which the system generates logs after the number of public route prefixes exceeds the limit is configured.
By default, the system generates logs at an interval of 5s after the number of public route prefixes exceeds the limit.
You can set a longer interval to decrease the frequency at which the system generates logs.