summaryrefslogtreecommitdiff
path: root/docs/configuration
diff options
context:
space:
mode:
authorLiudmylaNad <l.nadolina@vyos.io>2026-06-08 18:56:47 +0200
committerGitHub <noreply@github.com>2026-06-08 17:56:47 +0100
commitf01638d2e6ac85b0096a0895635c325569a7771a (patch)
tree76960f714853f30d1b21750e30d965d283c18993 /docs/configuration
parentb8a4d737a86015606a1faf0ab49b631db02448b2 (diff)
downloadvyos-documentation-f01638d2e6ac85b0096a0895635c325569a7771a.tar.gz
vyos-documentation-f01638d2e6ac85b0096a0895635c325569a7771a.zip
docs: Update Segment Routing page to VyOS 1.5 standards (#2067)
* docs: Update Segment Routing page to VyOS 1.5 standards * docs: Minor corrections * docs: Minor formatting corrections * Update segment-routing.md
Diffstat (limited to 'docs/configuration')
-rw-r--r--docs/configuration/protocols/segment-routing.md493
1 files changed, 334 insertions, 159 deletions
diff --git a/docs/configuration/protocols/segment-routing.md b/docs/configuration/protocols/segment-routing.md
index af47d343..b0896f73 100644
--- a/docs/configuration/protocols/segment-routing.md
+++ b/docs/configuration/protocols/segment-routing.md
@@ -1,259 +1,426 @@
+---
+myst:
+ html_meta:
+ description: |
+ Segment Routing (SR) is a source-routing network architecture in
+ which the ingress router attaches a list of Segment Identifiers
+ (SIDs) to each packet to define its forwarding path.
+ keywords: segment routing, sr, sid, srgb, srlb, mpls, isis, ospf
+---
+
(segment-routing)=
# Segment Routing
-Segment Routing (SR) is a network architecture that is similar to source-routing
-. In this architecture, the ingress router adds a list of segments, known as
-SIDs, to the packet as it enters the network. These segments represent different
-portions of the network path that the packet will take.
+{abbr}`SR (Segment Routing)` is a network architecture similar to source
+routing. The ingress router attaches a list of segments, known as
+{abbr}`SIDs (Segment Identifiers)`, to each packet as it enters the network.
+
+The SID list explicitly defines the path the packet will follow. At each
+node, the router reads the first SID, executes its forwarding instruction,
+and typically removes it so the next node can process the subsequent SID.
-The SR segments are portions of the network path taken by the packet, and are
-called SIDs. At each node, the first SID of the list is read, executed as a
-forwarding function, and may be popped to let the next node read the next SID of
-the list. The SID list completely determines the path where the packet is
-forwarded.
+SR relies on {abbr}`IGPs (Interior Gateway Protocols)` such as IS-IS or OSPF
+to advertise SIDs across the network.
-Segment Routing can be applied to an existing MPLS-based data plane and defines
-a control plane network architecture. In MPLS networks, segments are encoded as
-MPLS labels and are added at the ingress router. These MPLS labels are then
-exchanged and populated by Interior Gateway Protocols (IGPs) like IS-IS or OSPF
-which are running on most ISPs.
+```{note}
+SR defines a control plane architecture and can be applied to existing
+MPLS-based data planes. In MPLS networks, segments are encoded as MPLS
+labels and applied at the ingress router. These labels are then
+distributed across the routing domain by IGPs such as IS-IS (as described
+in [RFC 8667](https://datatracker.ietf.org/doc/html/rfc8667)) or OSPF.
+
+SR for the MPLS data plane supports IPv4, IPv6, and
+{abbr}`ECMP (Equal-Cost Multi-Path)`, and has been tested with Cisco and
+Juniper routers. However, this deployment is still experimental for FRR.
+```
-:::{note}
-Segment routing defines a control plane network architecture and
-can be applied to an existing MPLS based dataplane. In the MPLS networks,
-segments are encoded as MPLS labels and are imposed at the ingress router.
-MPLS labels are exchanged and populated by IGPs like IS-IS.Segment Routing
-as per RFC8667 for MPLS dataplane. It supports IPv4, IPv6 and ECMP and has
-been tested against Cisco & Juniper routers.however,this deployment is still
-EXPERIMENTAL for FRR.
-:::
+## IS-IS SR configuration
-## IS-IS SR Configuration
+Use the following commands to enable SR on IS-IS.
-Segment routing (SR) is used by the IGP protocols to interconnect network
-devices, below configuration shows how to enable SR on IS-IS:
+Known limitations:
-:::{note}
-``Known limitations:``
+- No support for level redistribution (L1 to L2 or L2 to L1).
+- No support for {abbr}`BSID (Binding SID)`.
+- Only a single {abbr}`SRGB (Segment Routing Global Block)` and the default
+ {abbr}`SPF (Shortest Path First)` algorithm are supported.
-No support for level redistribution (L1 to L2 or L2 to L1)
+```{cfgcmd} set protocols isis segment-routing global-block high-label-value \<16-1048575\>
-No support for binding SID
+**Configure the upper bound of the Segment Routing Global Block (SRGB).**
-No support for SRLB
+The SRGB defines the range of MPLS labels reserved for mapping global
+segments, such as Prefix-SIDs, to FIB entries.
-Only one SRGB and default SPF Algorithm is supported
-:::
+The range cannot exceed 65535 labels.
+```
-```{cfgcmd} set protocols isis segment-routing global-block high-label-value \<label-value\>
+Example:
-Set the Segment Routing Global Block i.e. the label range used by MPLS to
-store label in the MPLS FIB for Prefix SID. Note that the block size may
-not exceed 65535.
+```none
+set protocols isis segment-routing global-block high-label-value 23999
```
+```{cfgcmd} set protocols isis segment-routing global-block low-label-value \<16-1048575\>
-```{cfgcmd} set protocols isis segment-routing global-block low-label-value \<label-value\>
+**Configure the lower bound of the Segment Routing Global Block (SRGB).**
-Set the Segment Routing Global Block i.e. the low label range used by MPLS to
-store label in the MPLS FIB for Prefix SID. Note that the block size may
-not exceed 65535.
+The SRGB defines the range of MPLS labels reserved for mapping global
+segments, such as Prefix-SIDs, to FIB entries.
+
+The range cannot exceed 65535 labels.
```
+Example:
+
+```none
+set protocols isis segment-routing global-block low-label-value 16000
+```
+
+```{cfgcmd} set protocols isis segment-routing local-block high-label-value \<16-1048575\>
+
+**Configure the upper bound of the Segment Routing Local Block (SRLB).**
+
+The SRLB defines the range of MPLS labels that a router reserves for its
+local segments, such as Adjacency-SIDs.
+
+The range cannot exceed 65535 labels.
+```
-```{cfgcmd} set protocols isis segment-routing local-block high-label-value \<label-value\>
+Example:
-Set the Segment Routing Local Block i.e. the label range used by MPLS to
-store label in the MPLS FIB for Prefix SID. Note that the block size may
-not exceed 65535.Segment Routing Local Block, The negative command always
-unsets both.
+```none
+set protocols isis segment-routing local-block high-label-value 15999
```
+```{cfgcmd} set protocols isis segment-routing local-block low-label-value \<16-1048575\>
+
+**Configure the lower bound of the Segment Routing Local Block (SRLB).**
+
+The SRLB defines the range of MPLS labels that a router reserves for its
+local segments, such as Adjacency-SIDs.
+
+The range cannot exceed 65535 labels.
+```
-```{cfgcmd} set protocols isis segment-routing local-block \<low-label-value \<label-value\>
+Example:
-Set the Segment Routing Local Block i.e. the low label range used by MPLS to
-store label in the MPLS FIB for Prefix SID. Note that the block size may
-not exceed 65535.Segment Routing Local Block, The negative command always
-unsets both.
+```none
+set protocols isis segment-routing local-block low-label-value 15000
```
+```{note}
+SR label blocks have the following configuration constraints:
+
+- Both bounds (`high-label-value` and `low-label-value`) must be set.
+ Removing either bound also removes the other.
+- `local-block` requires `global-block` to be configured.
+- The SRGB and SRLB ranges must not overlap.
+
+Violating any of these causes the commit to fail.
+```
```{cfgcmd} set protocols isis segment-routing maximum-label-depth \<1-16\>
-Set the Maximum Stack Depth supported by the router. The value depend of
-the MPLS dataplane.
+**Configure the {abbr}`MSD (Maximum SID Depth)` supported by the router.**
+
+The value depends on the MPLS data plane.
```
+Example:
+
+```none
+set protocols isis segment-routing maximum-label-depth 10
+```
```{cfgcmd} set protocols isis segment-routing prefix \<address\> index value \<0-65535\>
-A segment ID that contains an IP address prefix calculated by an IGP in the
-service provider core network. Prefix SIDs are globally unique, this value
-identify it
+**Configure a Prefix-SID with an index value for the specified IP prefix.**
+
+A Prefix-SID is a Segment Identifier associated with an IP prefix and
+distributed by the IGP (IS-IS).
```
+Example:
-```{cfgcmd} set protocols isis segment-routing prefix \<address\> index \<no-php-flag | explicit-null| n-flag-clear\>
+```none
+set protocols isis segment-routing prefix 192.0.2.1/32 index value 1
+```
+
+```{cfgcmd} set protocols isis segment-routing prefix \<address\> index \<no-php-flag | explicit-null\>
-this option allows to configure prefix-sid on SR. The ‘no-php-flag’ means NO
-Penultimate Hop Popping that allows SR node to request to its neighbor to
-not pop the label. The ‘explicit-null’ flag allows SR node to request to its
-neighbor to send IP packet with the EXPLICIT-NULL label. The ‘n-flag-clear’
-option can be used to explicitly clear the Node flag that is set by default
-for Prefix-SIDs associated to loopback addresses. This option is necessary
-to configure Anycast-SIDs.
+**Configure a label processing flag for the indexed Prefix-SID associated
+with the specified IP prefix:**
+
+- `no-php-flag`: Requests the upstream neighbor not to pop the Prefix-SID
+ label before forwarding the packet.
+- `explicit-null`: Requests that the upstream neighbor forwards the packet
+ with the Explicit-Null label.
```
-```{opcmd} show isis segment-routing node
+Example:
- Show detailed information about all learned Segment Routing Nodes
+```none
+set protocols isis segment-routing prefix 192.0.2.1/32 index no-php-flag
```
+```{cfgcmd} set protocols isis segment-routing prefix \<address\> absolute value \<16-1048575\>
-```{opcmd} show isis route prefix-sid
+**Configure a Prefix-SID with an absolute value for the specified IP
+prefix**
-Show detailed information about prefix-sid and label learned
+A Prefix-SID is a Segment Identifier associated with an IP prefix and
+distributed by the IGP (IS-IS).
```
-:::{note}
-more information related IGP - {ref}`routing-isis`
-:::
+Example:
+```none
+set protocols isis segment-routing prefix 192.0.2.1/32 absolute value 16001
+```
-## OSPF SR Configuration
+```{cfgcmd} set protocols isis segment-routing prefix \<address\> absolute \<no-php-flag | explicit-null\>
+**Configure a label processing flag for the absolute Prefix-SID associated
+with the specified IP prefix:**
-Segment routing (SR) is used by the IGP protocols to interconnect network
-devices, below configuration shows how to enable SR on OSPF:
+* `no-php-flag`: Requests the upstream neighbor not to pop the Prefix-SID
+ label before forwarding the packet.
+* `explicit-null`: Requests that the upstream neighbor forwards the packet
+ with the Explicit-Null label.
+```
+
+Example:
+
+```none
+set protocols isis segment-routing prefix 192.0.2.1/32 absolute no-php-flag
+```
+
+### Operational commands
+
+```{opcmd} show isis segment-routing node
+
+**Show all learned SR nodes.**
+```
+
+```{opcmd} show isis route prefix-sid
+
+**Show all learned Prefix-SIDs and their MPLS labels.**
+```
+
+```{note}
+For more information, see {ref}`isis`.
+```
+
+## OSPF SR configuration
+
+Use the following commands to enable SR on OSPF.
```{cfgcmd} set protocols ospf parameters opaque-lsa
-Enable the Opaque-LSA capability (rfc2370), necessary to transport label
-on IGP
+**Enable Opaque {abbr}`LSA (Link State Advertisement)`
+([RFC 2370](https://datatracker.ietf.org/doc/html/rfc2370)) in OSPF.**
+
+Opaque LSAs are required to transport MPLS labels via OSPF.
```
-```{cfgcmd} set protocols ospf segment-routing global-block high-label-value \<label-value\>
+Example:
-Set the Segment Routing Global Block i.e. the label range used by MPLS to
-store label in the MPLS FIB for Prefix SID. Note that the block size may
-not exceed 65535.
+```none
+set protocols ospf parameters opaque-lsa
```
-```{cfgcmd} set protocols ospf segment-routing global-block low-label-value \<label-value\>
+```{cfgcmd} set protocols ospf segment-routing global-block high-label-value \<16-1048575\>
-Set the Segment Routing Global Block i.e. the low label range used by MPLS to
-store label in the MPLS FIB for Prefix SID. Note that the block size may
-not exceed 65535.
+**Configure the upper bound of the Segment Routing Global Block (SRGB).**
+
+The SRGB defines the range of MPLS labels reserved for mapping Prefix-SIDs
+to FIB entries.
+
+The range cannot exceed 65535 labels.
+```
+
+Example:
+
+```none
+set protocols ospf segment-routing global-block high-label-value 23999
+```
+
+```{cfgcmd} set protocols ospf segment-routing global-block low-label-value \<16-1048575\>
+
+**Configure the lower bound of the Segment Routing Global Block (SRGB).**
+
+The SRGB defines the range of MPLS labels reserved for mapping Prefix-SIDs
+to FIB entries.
+
+The range cannot exceed 65535 labels.
+```
+
+Example:
+
+```none
+set protocols ospf segment-routing global-block low-label-value 16000
+```
+
+```{cfgcmd} set protocols ospf segment-routing local-block high-label-value \<16-1048575\>
+
+**Configure the upper bound of the Segment Routing Local Block (SRLB).**
+
+The SRLB defines the range of MPLS labels that a router reserves for its
+local segments, such as Adjacency-SIDs.
+
+The range cannot exceed 65535 labels.
+```
+
+Example:
+
+```none
+set protocols ospf segment-routing local-block high-label-value 15999
+```
+
+```{cfgcmd} set protocols ospf segment-routing local-block low-label-value \<16-1048575\>
+
+**Configure the lower bound of the Segment Routing Local Block (SRLB).**
+
+The SRLB defines the range of MPLS labels that a router reserves for its
+local segments, such as Adjacency-SIDs.
+
+The range cannot exceed 65535 labels.
```
-```{cfgcmd} set protocols ospf segment-routing local-block high-label-value \<label-value\>
+Example:
-Set the Segment Routing Local Block i.e. the label range used by MPLS to
-store label in the MPLS FIB for Prefix SID. Note that the block size may
-not exceed 65535.Segment Routing Local Block, The negative command always
-unsets both.
+```none
+set protocols ospf segment-routing local-block low-label-value 15000
```
-```{cfgcmd} set protocols ospf segment-routing local-block \<low-label-value \<label-value\>
+```{note}
+SR label blocks have the following configuration constraints:
+
+- Both bounds (`high-label-value` and `low-label-value`) must be set.
+ Removing either bound also removes the other.
+- `local-block` requires `global-block` to be configured.
+- The SRGB and SRLB ranges must not overlap.
-Set the Segment Routing Local Block i.e. the low label range used by MPLS to
-store label in the MPLS FIB for Prefix SID. Note that the block size may
-not exceed 65535.Segment Routing Local Block, The negative command always
-unsets both.
+Violating any of these causes the commit to fail.
```
```{cfgcmd} set protocols ospf segment-routing maximum-label-depth \<1-16\>
-Set the Maximum Stack Depth supported by the router. The value depend of
-the MPLS dataplane.
+**Configure the {abbr}`MSD (Maximum SID Depth)` supported by the router.**
+
+The value depends on the MPLS data plane.
+```
+
+Example:
+
+```none
+set protocols ospf segment-routing maximum-label-depth 10
```
```{cfgcmd} set protocols ospf segment-routing prefix \<address\> index value \<0-65535\>
-A segment ID that contains an IP address prefix calculated by an IGP in the
-service provider core network. Prefix SIDs are globally unique, this value
-identify it
+**Configure a Prefix-SID for the specified IP prefix.**
+
+A Prefix-SID is a Segment Identifier associated with an IP prefix and
+distributed by the IGP (OSPF).
+
+Prefix-SIDs are unique within an SR domain.
```
-```{cfgcmd} set protocols ospf segment-routing prefix \<address\> index \<no-php-flag | explicit-null| n-flag-clear\>
+Example:
-this option allows to configure prefix-sid on SR. The ‘no-php-flag’ means NO
-Penultimate Hop Popping that allows SR node to request to its neighbor to
-not pop the label. The ‘explicit-null’ flag allows SR node to request to its
-neighbor to send IP packet with the EXPLICIT-NULL label. The ‘n-flag-clear’
-option can be used to explicitly clear the Node flag that is set by default
-for Prefix-SIDs associated to loopback addresses. This option is necessary
-to configure Anycast-SIDs.
+```none
+set protocols ospf segment-routing prefix 192.0.2.1/32 index value 1
```
-:::{note}
-more information related IGP - {ref}`routing-ospf`
-:::
+```{cfgcmd} set protocols ospf segment-routing prefix \<address\> index \<no-php-flag | explicit-null\>
-## Configuration Example
+**Configure a label processing flag for the Prefix-SID associated with the
+specified IP prefix:**
-we described the configuration SR ISIS / SR OSPF using 2 connected with them to
-share label information.
+- `no-php-flag`: Requests the upstream neighbor not to pop the Prefix-SID
+ label before forwarding the packet.
+- `explicit-null`: Requests that the upstream neighbor forwards the packet
+ with the Explicit-Null label.
+```
-### Enable IS-IS with Segment Routing (Experimental)
+Example:
+
+```none
+set protocols ospf segment-routing prefix 192.0.2.1/32 index no-php-flag
+```
+
+```{note}
+For more information, see {ref}`ospf`.
+```
+
+## Examples
+
+### Enable SR on IS-IS (experimental)
+
+The following example demonstrates a basic two-node SR topology using IS-IS.
**Node 1:**
```none
-set interfaces loopback lo address '192.168.255.255/32'
+set interfaces loopback lo address '198.51.100.1/32'
set interfaces ethernet eth1 address '192.0.2.1/24'
set protocols isis interface eth1
set protocols isis interface lo
-set protocols isis net '49.0001.1921.6825.5255.00'
+set protocols isis net '49.0001.1980.5110.0001.00'
set protocols isis segment-routing global-block high-label-value '599'
set protocols isis segment-routing global-block low-label-value '550'
-set protocols isis segment-routing prefix 192.168.255.255/32 index value '1'
-set protocols isis segment-routing prefix 192.168.255.255/32 index explicit-null
+set protocols isis segment-routing prefix 198.51.100.1/32 index value '1'
+set protocols isis segment-routing prefix 198.51.100.1/32 index explicit-null
set protocols mpls interface 'eth1'
```
**Node 2:**
```none
-set interfaces loopback lo address '192.168.255.254/32'
+set interfaces loopback lo address '198.51.100.2/32'
set interfaces ethernet eth1 address '192.0.2.2/24'
set protocols isis interface eth1
set protocols isis interface lo
-set protocols isis net '49.0001.1921.6825.5254.00'
+set protocols isis net '49.0001.1980.5110.0002.00'
set protocols isis segment-routing global-block high-label-value '599'
set protocols isis segment-routing global-block low-label-value '550'
-set protocols isis segment-routing prefix 192.168.255.254/32 index value '2'
-set protocols isis segment-routing prefix 192.168.255.254/32 index explicit-null
+set protocols isis segment-routing prefix 198.51.100.2/32 index value '2'
+set protocols isis segment-routing prefix 198.51.100.2/32 index explicit-null
set protocols mpls interface 'eth1'
```
-This gives us MPLS segment routing enabled and labels for far end loopbacks:
+The following outputs show that MPLS Segment Routing is enabled and that
+each router has learned MPLS labels for the other router's loopback:
```none
Node-1@vyos:~$ show mpls table
Inbound Label Type Nexthop Outbound Label
----------------------------------------------------------------------
- 552 SR (IS-IS) 192.0.2.2 IPv4 Explicit Null <-- Node-2 loopback learned on Node-1
+ 552 SR (IS-IS) 192.0.2.2 IPv4 Explicit Null <-- Node-2 loopback learned on Node-1
15000 SR (IS-IS) 192.0.2.2 implicit-null
15001 SR (IS-IS) fe80::e87:6cff:fe09:1 implicit-null
15002 SR (IS-IS) 192.0.2.2 implicit-null
15003 SR (IS-IS) fe80::e87:6cff:fe09:1 implicit-null
+```
+```none
Node-2@vyos:~$ show mpls table
Inbound Label Type Nexthop Outbound Label
---------------------------------------------------------------------
- 551 SR (IS-IS) 192.0.2.1 IPv4 Explicit Null <-- Node-1 loopback learned on Node-2
+ 551 SR (IS-IS) 192.0.2.1 IPv4 Explicit Null <-- Node-1 loopback learned on Node-2
15000 SR (IS-IS) 192.0.2.1 implicit-null
15001 SR (IS-IS) fe80::e33:2ff:fe80:1 implicit-null
15002 SR (IS-IS) 192.0.2.1 implicit-null
15003 SR (IS-IS) fe80::e33:2ff:fe80:1 implicit-null
```
-Here is the routing tables showing the MPLS segment routing label operations:
+The following outputs show MPLS Segment Routing label assignments for IP
+routes:
```none
Node-1@vyos:~$ show ip route isis
@@ -265,8 +432,10 @@ Codes: K - kernel route, C - connected, S - static, R - RIP,
t - trapped, o - offload failure
I 192.0.2.0/24 [115/20] via 192.0.2.2, eth1 inactive, weight 1, 00:07:48
-I>* 192.168.255.254/32 [115/20] via 192.0.2.2, eth1, label IPv4 Explicit Null, weight 1, 00:03:39
+I>* 198.51.100.2/32 [115/20] via 192.0.2.2, eth1, label IPv4 Explicit Null, weight 1, 00:03:39
+```
+```none
Node-2@vyos:~$ show ip route isis
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
@@ -276,61 +445,65 @@ Codes: K - kernel route, C - connected, S - static, R - RIP,
t - trapped, o - offload failure
I 192.0.2.0/24 [115/20] via 192.0.2.1, eth1 inactive, weight 1, 00:07:46
-I>* 192.168.255.255/32 [115/20] via 192.0.2.1, eth1, label IPv4 Explicit Null, weight 1, 00:03:43
+I>* 198.51.100.1/32 [115/20] via 192.0.2.1, eth1, label IPv4 Explicit Null, weight 1, 00:03:43
```
+### Enable SR on OSPF (experimental)
-### Enable OSPF with Segment Routing (Experimental):
+The following example demonstrates a basic two-node SR topology using OSPF.
-**Node 1**
+**Node 1:**
```none
-set interfaces loopback lo address 10.1.1.1/32
-set interfaces ethernet eth0 address 192.168.0.1/24
-set protocols ospf area 0 network '192.168.0.0/24'
-set protocols ospf area 0 network '10.1.1.1/32'
+set interfaces loopback lo address 198.51.100.1/32
+set interfaces ethernet eth0 address 192.0.2.1/24
+set protocols ospf area 0 network '192.0.2.0/24'
+set protocols ospf area 0 network '198.51.100.1/32'
set protocols ospf parameters opaque-lsa
-set protocols ospf parameters router-id '10.1.1.1'
+set protocols ospf parameters router-id '198.51.100.1'
set protocols ospf segment-routing global-block high-label-value '1100'
set protocols ospf segment-routing global-block low-label-value '1000'
-set protocols ospf segment-routing prefix 10.1.1.1/32 index explicit-null
-set protocols ospf segment-routing prefix 10.1.1.1/32 index value '1'
+set protocols ospf segment-routing prefix 198.51.100.1/32 index explicit-null
+set protocols ospf segment-routing prefix 198.51.100.1/32 index value '1'
```
-**Node 2**
+**Node 2:**
```none
-set interfaces loopback lo address 10.1.1.2/32
-set interfaces ethernet eth0 address 192.168.0.2/24
-set protocols ospf area 0 network '192.168.0.0/24'
-set protocols ospf area 0 network '10.1.1.2/32'
+set interfaces loopback lo address 198.51.100.2/32
+set interfaces ethernet eth0 address 192.0.2.2/24
+set protocols ospf area 0 network '192.0.2.0/24'
+set protocols ospf area 0 network '198.51.100.2/32'
set protocols ospf parameters opaque-lsa
-set protocols ospf parameters router-id '10.1.1.2'
+set protocols ospf parameters router-id '198.51.100.2'
set protocols ospf segment-routing global-block high-label-value '1100'
set protocols ospf segment-routing global-block low-label-value '1000'
-set protocols ospf segment-routing prefix 10.1.1.2/32 index explicit-null
-set protocols ospf segment-routing prefix 10.1.1.2/32 index value '2'
+set protocols ospf segment-routing prefix 198.51.100.2/32 index explicit-null
+set protocols ospf segment-routing prefix 198.51.100.2/32 index value '2'
```
-This gives us MPLS segment routing enabled and labels for far end loopbacks:
+The following outputs show MPLS Segment Routing label assignments:
```none
Node-1@vyos:~$ show mpls table
Inbound Label Type Nexthop Outbound Label
-----------------------------------------------------------
- 1002 SR (OSPF) 192.168.0.2 IPv4 Explicit Null <-- Node-2 loopback learned on Node-1
- 15000 SR (OSPF) 192.168.0.2 implicit-null
- 15001 SR (OSPF) 192.168.0.2 implicit-null
+ 1002 SR (OSPF) 192.0.2.2 IPv4 Explicit Null <-- Node-2 loopback learned on Node-1
+ 15000 SR (OSPF) 192.0.2.2 implicit-null
+ 15001 SR (OSPF) 192.0.2.2 implicit-null
+```
+```none
Node-2@vyos:~$ show mpls table
Inbound Label Type Nexthop Outbound Label
-----------------------------------------------------------
- 1001 SR (OSPF) 192.168.0.1 IPv4 Explicit Null <-- Node-1 loopback learned on Node-2
- 15000 SR (OSPF) 192.168.0.1 implicit-null
- 15001 SR (OSPF) 192.168.0.1 implicit-null
+ 1001 SR (OSPF) 192.0.2.1 IPv4 Explicit Null <-- Node-1 loopback learned on Node-2
+ 15000 SR (OSPF) 192.0.2.1 implicit-null
+ 15001 SR (OSPF) 192.0.2.1 implicit-null
```
-Here is the routing tables showing the MPLS segment routing label operations:
+The following outputs show MPLS Segment Routing label assignments for IP
+routes:
```none
Node-1@vyos:~$ show ip route ospf
@@ -341,10 +514,12 @@ Codes: K - kernel route, C - connected, S - static, R - RIP,
> - selected route, * - FIB route, q - queued, r - rejected, b - backup
t - trapped, o - offload failure
-O 10.1.1.1/32 [110/0] is directly connected, lo, weight 1, 00:03:43
-O>* 10.1.1.2/32 [110/1] via 192.168.0.2, eth0, label IPv4 Explicit Null, weight 1, 00:03:32
-O 192.168.0.0/24 [110/1] is directly connected, eth0, weight 1, 00:03:43
+O 198.51.100.1/32 [110/0] is directly connected, lo, weight 1, 00:03:43
+O>* 198.51.100.2/32 [110/1] via 192.0.2.2, eth0, label IPv4 Explicit Null, weight 1, 00:03:32
+O 192.0.2.0/24 [110/1] is directly connected, eth0, weight 1, 00:03:43
+```
+```none
Node-2@vyos:~$ show ip route ospf
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
@@ -353,7 +528,7 @@ Codes: K - kernel route, C - connected, S - static, R - RIP,
> - selected route, * - FIB route, q - queued, r - rejected, b - backup
t - trapped, o - offload failure
-O>* 10.1.1.1/32 [110/1] via 192.168.0.1, eth0, label IPv4 Explicit Null, weight 1, 00:03:36
-O 10.1.1.2/32 [110/0] is directly connected, lo, weight 1, 00:03:51
-O 192.168.0.0/24 [110/1] is directly connected, eth0, weight 1, 00:03:51
+O>* 198.51.100.1/32 [110/1] via 192.0.2.1, eth0, label IPv4 Explicit Null, weight 1, 00:03:36
+O 198.51.100.2/32 [110/0] is directly connected, lo, weight 1, 00:03:51
+O 192.0.2.0/24 [110/1] is directly connected, eth0, weight 1, 00:03:51
```