(Optional) Configuring the Constant Interface Index Feature
Context
This section describes how to configure the constant interface index feature. This feature allows some interface indexes remain unchanged in the case of interface deletion or addition, system restart, or hardware or software configuration change to meet the need of some functions such as accounting and fault diagnosis that require fixed interfaces.
Procedure
- Run:
system-view
The system view is displayed.
- Run:
ifindex constant
The constant interface index feature is enabled.
After the feature is enabled, the indexes for all the existing interfaces and newly created interfaces are fixed. If the system needs to restart, the save command must be run to save interface configurations; otherwise, the interface indexes will change after the system is restarted.
- Run:
set constant-ifindex max-number number
The maximum number of interfaces indexed by fixed numbers is set.
If interfaces are frequently added or deleted during system operation, the interface index file stored in the device may have a great size and consume too many system resources. Setting the maximum number of interfaces indexed by fixed numbers can prevent the interface index file from exceeding an expected size.
After the maximum number of interfaces indexed by fixed numbers is set, the system will allocate fixed indexes to interfaces within the specified value range. If the specified value is smaller than the number of interfaces configured on the device, the system allocates fixed interface indexes to the interfaces enabled earlier. The interfaces enabled later are not indexed by fixed numbers.
By default, a maximum of 131070 interfaces can be indexed by fixed numbers. If the value is set to 0, no interfaces will be indexed by fixed numbers.