The ospf prefix-sid command configures a prefix segment ID (SID) for the IP address of a loopback interface.
The undo ospf prefix-sid command deletes the prefix SID configured for the IP address of a loopback interface.
By default, no prefix SID is configured for the IP address of a loopback interface.
Parameter | Description | Value |
---|---|---|
absolute sid-value |
Specifies an absolute label value, which is an effective SID. |
The value varies according to the device. |
index index-value |
Specifies a relative label value, which is also called the offset value. The relative label value is relative to the minimum value of the SRGB range. (Actual SID = index-value + Start SRGB value). The relative label value cannot exceed the locally configured SRGB range. The relative label value must be unique in the same OSPF process. If index-value is specified, the advertised prefix SID is index-value. If sid-value is configured, the advertised prefix SID is the specified sid-value minus the start SRGB value. |
The value is an integer ranging from 0 to 65534. |
node-disable |
Cancels the N flag. The TI-LFA algorithm preferentially selects the node with the N flag. As such, if the node-disable parameter is specified to cancel the N flag, the node with this flag will not be preferentially selected. |
- |
Usage Scenario
The IP address of a loopback interface can identify a node. If a prefix SID is configured for the IP address, the prefix SID can also identify the node in the SR domain and guide packets to be forwarded to the local node along the shortest path.
Prerequisites
OSPF has been enabled on a loopback interface using the ospf enable command.
Segment Routing has been enabled for a specific OSPF topology using the segment-routing mpls command in an OSPF process.Precautions
A loopback interface can be assigned an IP address. The prefix SIDs take effect only if an IP address with a 32-bit mask is assigned to the loopback interface.
This command takes effect only on the primary IP address of a loopback interface. If the prefix SID value is beyond the SRGB range, the prefix SID will not be advertised.<HUAWEI> system-view [~HUAWEI] segment-routing [*HUAWEI-segment-routing] quit [*HUAWEI] ospf 1 [*HUAWEI-ospf-1] opaque-capability enable [*HUAWEI-ospf-1] segment-routing mpls [*HUAWEI-ospf-1] quit [*HUAWEI] interface loopback0 [*HUAWEI-LoopBack0] ospf enable 1 area 1 [*HUAWEI-LoopBack0] ospf prefix-sid index 100