< Home

ip prefix-limit

Function

The ip prefix-limit command configures a limit on the number of IPv4 public route prefixes.

The undo ip prefix-limit command restores the default configuration.

By default, the maximum number of IPv4 public route prefixes is not limited.

Format

ip prefix-limit number { alert-percent [ route-unchanged ] | simply-alert }

undo ip prefix-limit

Parameters

Parameter Description Value
number

Specifies the maximum number of IPv4 public route prefixes.

The value is an integer, and the minimum value is 1. The maximum number is determined by the license file.
alert-percent

Specifies the percentage of the maximum number of IPv4 public route prefixes. If you specify alert-percent in the command, when the number of IPv4 public route prefixes exceeds the value calculated by (number x alert-percent) /100, an alarm is generated. Additional IPv4 public route prefixes can still be added to the routing table until the number of IPv4 public route prefixes reaches number. Subsequent route prefixes are discarded.

The value is an integer ranging from 1 to 100.
route-unchanged
Indicates that the routing table remains unchanged. If you decrease alert-percent after the number of IPv4 public route prefixes exceeds number, whether the routing table remains unchanged is determined by route-unchanged.
  • If you specify route-unchanged in the command, the routing table remains unchanged.

  • If you do not specify route-unchanged in the command, the system deletes the routes from the routing table and re-adds routes.

By default, the system deletes the routes from the routing table and re-adds routes.

-
simply-alert

Indicates the following function: If you specify simply-alert in the command, new IPv4 public route prefixes can still be added to the routing table and only an alarm is generated after the number of IPv4 public route prefixes exceeds 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 IPv4 public route prefixes are discarded.

-

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

If the switch imports a large number of routes, system performance may be affected when processing services because the routes consume a lot of system resources. To improve system security and reliability, you can run the ip prefix-limit command to configure a limit on the number of IPv4 public route prefixes. When the number of IPv4 public route prefixes exceeds the limit, an alarm is generated, prompting you to check whether unneeded IPv4 public route prefixes exist.

Configuration Impact

After the ip prefix-limit command is run, the switch may discard unneeded IPv4 public route prefixes.

  • If the number of IPv4 public route prefixes exceeds the value calculated from number x alert-percent/100, an alarm (RM_1.3.6.1.4.1.2011.5.25.145.19.1.3 hwPublicIpv4PrefixThresholdExceed) is generated.
  • If the number of IPv4 public route prefixes exceeds number, an alarm (RM_1.3.6.1.4.1.2011.5.25.145.19.1.1 hwPublicIpv4PrefixExceed) is generated.
  • If the number of IPv4 public route prefixes falls below the value calculated from (number x (alert-percent – 5))/100, a clear alarm (RM_1.3.6.1.4.1.2011.5.25.145.19.1.4 hwPublicIpv4PrefixThresholdExceedClear) is generated.
  • If the number of IPv4 public route prefixes exceeds number, a clear alarm (RM_1.3.6.1.4.1.2011.5.25.145.19.1.2 hwPublicIpv4PrefixExceedClear) is generated.

Precautions

If you run the ip prefix-limit command for several times, the last configuration overrides previous configurations.

After the number of IPv4 public route prefixes exceeds the limit, note the following rules:
  • If you run the ip prefix-limit command to increase number or the undo ip prefix-limit command to delete the limit, the switch relearns IPv4 public route prefixes.
  • Direct and static routes can still be added to the IP routing table.

Example

# Configure simply-alert so that only an alarm is generated when the switch imports more than 10000 IPv4 public route prefixes.

<HUAWEI> system-view
[HUAWEI] ip prefix-limit 10000 simply-alert
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >