SRMS Configuration
R5
R5(config)#segment-routing | Entering to Segment Routing. |
R5(config-sr)#mapping-server | Entering to Mapping Server |
R5(config-sr-ms)#prefix-sid-map address-family ipv4 | Entering to prefix-to SID mapping. |
R5(config-sr-ms-map-af4)#21.21.21.21/32 4545 attached | Configure SID for prefix. |
R5(config-sr-ms-map-af4)#31.31.31.31/32 3535 attached | Configure SID for prefix. |
R5(config-sr-ms-map-af4)#end | Exit from SRMS. |
R5#configure terminal | Entering to Config mode. |
R5(config)#router ospf 100 | Entering to router OSPF mode. |
R5(config-router)#segment-routing prefix-sid-map advertise-local | Configure advertise-local for prefix-sid mapping. |
R5(config-router)#exit | Exit from router OSPF mode |
R3
R3(config)#segment-routing | Entering to Segment Routing |
R3(config-sr)#mapping-server | Entering to Mapping Server |
R3(config-sr-ms)#prefix-sid-map address-family ipv4 | Entering to prefix-to SID mapping. |
R3(config-sr-ms-map-af4)#11.11.11.11/32 1111 range 3 | Configure SID for prefix. |
R3(config-sr-ms-map-af4)#12.12.12.12/32 6767 range 1 | Configure SID for prefix. |
R3(config-sr-ms-map-af4)#end | Exit from SRMS. |
R3#configure terminal | Entering to Config mode. |
R3(config)#router ospf 100 | Entering to router OSPF mode. |
R3(config-router)#segment-routing prefix-sid-map advertise-local | Configure advertise-local for prefix-sid mapping. |
R3(config-router)#exit | Exit from router OSPF mode |
Validation on R3
OSPF Database
R3#show ip ospf database opaque-area self-originate
OSPF Router with ID (3.3.3.3) (Process ID 100 VRF default)
Area-Local Opaque-LSA (Area 0.0.0.0)
LS age: 851
Options: 0x22 (-|-|DC|-|-|-|E|-)
LS Type: Area-Local Opaque-LSA
Link State ID: 1.0.0.1 (Area-Local Opaque-Type/ID)
Opaque Type: 1
Opaque ID: 1
Advertising Router: 3.3.3.3
LS Seq Number: 80000003
Checksum: 0x34e0
Length: 28
MPLS TE router ID : 3.3.3.3
Number of Links : 0
LS age: 1421
Options: 0x22 (-|-|DC|-|-|-|E|-)
LS Type: Area-Local Opaque-LSA
Link State ID: 1.0.0.22 (Area-Local Opaque-Type/ID)
Opaque Type: 1
Opaque ID: 22
Advertising Router: 3.3.3.3
LS Seq Number: 80000002
Checksum: 0xb77f
Length: 108
Link connected to Broadcast network
Link ID : 11.1.1.1
Interface Address : 11.1.1.2
Admin Metric : 1
Maximum bandwidth : 10000000.00 Kbits/s
Maximum reservable bandwidth : 10000000.00 Kbits/s
Unreserved Bandwidth :
Number of Priority : 8
Priority 0 : 10000000.00 Kbits/s Priority 1 : 10000000.00 Kbits/s
Priority 2 : 10000000.00 Kbits/s Priority 3 : 10000000.00 Kbits/s
Priority 4 : 10000000.00 Kbits/s Priority 5 : 10000000.00 Kbits/s
Priority 6 : 10000000.00 Kbits/s Priority 7 : 10000000.00 Kbits/s
Number of Links : 1
LS age: 1321
Options: 0x22 (-|-|DC|-|-|-|E|-)
LS Type: Area-Local Opaque-LSA
Link State ID: 1.0.0.32 (Area-Local Opaque-Type/ID)
Opaque Type: 1
Opaque ID: 32
Advertising Router: 3.3.3.3
LS Seq Number: 80000002
Checksum: 0x9792
Length: 108
Link connected to Broadcast network
Link ID : 12.1.1.2
Interface Address : 12.1.1.2
Admin Metric : 1
Maximum bandwidth : 10000000.00 Kbits/s
Maximum reservable bandwidth : 10000000.00 Kbits/s
Unreserved Bandwidth :
Number of Priority : 8
Priority 0 : 10000000.00 Kbits/s Priority 1 : 10000000.00 Kbits/s
Priority 2 : 10000000.00 Kbits/s Priority 3 : 10000000.00 Kbits/s
Priority 4 : 10000000.00 Kbits/s Priority 5 : 10000000.00 Kbits/s
Priority 6 : 10000000.00 Kbits/s Priority 7 : 10000000.00 Kbits/s
Number of Links : 1
LS age: 153
Options: 0x22 (-|-|DC|-|-|-|E|-)
LS Type: Area-Local Opaque-LSA
Link State ID: 4.0.0.0 (Area-Local Opaque-Type/ID)
Opaque Type: 4
Opaque ID: 0
Advertising Router: 3.3.3.3
LS Seq Number: 80000003
Checksum: 0x73c4
Length: 52
Range Size: 8000
Base-SID: 16000
Algorithm0: 0
Preference: 128
LS age: 1081
Options: 0x22 (-|-|DC|-|-|-|E|-)
LS Type: Area-Local Opaque-LSA
Link State ID: 7.0.0.0 (Area-Local Opaque-Type/ID)
Opaque Type: 7
Opaque ID: 0
Advertising Router: 3.3.3.3
LS Seq Number: 80000002
Checksum: 0x085d
Length: 68
Prefix type : Extended Prefix TLV
Route Type: 1
Prefix Length: 32
AF: 0
Flags: 0x40 (-|N|-|-|-|-|-|-)
Address Prefix: 3.3.3.3
Flags: 0x08 (-|-|-|-|V|-|-|-)
MT-ID: 0
Algorithm: 0
SID: 18003
Prefix type : Extended Prefix TLV
Route Type: 3
Prefix Length: 32
AF: 0
Flags: 0x40 (-|N|-|-|-|-|-|-)
Address Prefix: 1.1.1.1
Flags: 0x48 (-|NP|-|-|V|-|-|-)
MT-ID: 0
Algorithm: 0
SID: 18001
LS age: 153
Options: 0x22 (-|-|DC|-|-|-|E|-)
LS Type: Area-Local Opaque-LSA
Link State ID: 7.0.0.1 (Area-Local Opaque-Type/ID)
Opaque Type: 7
Opaque ID: 1
Advertising Router: 3.3.3.3
LS Seq Number: 80000001
Checksum: 0x6cb2
Length: 48
Prefix type : Extended Prefix Range TLV
Prefix Length: 32
AF: 0
Range: 3
Flags: 0x00 (-|-|-|-|-|-|-|-)
Address Prefix: 11.11.11.11
Flags: 0x20 (-|-|M|-|-|-|-|-)
MT-ID: 0
Algorithm: 0
SID: 1111
LS age: 153
Options: 0x22 (-|-|DC|-|-|-|E|-)
LS Type: Area-Local Opaque-LSA
Link State ID: 7.0.0.2 (Area-Local Opaque-Type/ID)
Opaque Type: 7
Opaque ID: 2
Advertising Router: 3.3.3.3
LS Seq Number: 80000001
Checksum: 0xe30a
Length: 48
Prefix type : Extended Prefix Range TLV
Prefix Length: 32
AF: 0
Range: 1
Flags: 0x00 (-|-|-|-|-|-|-|-)
Address Prefix: 12.12.12.12
Flags: 0x20 (-|-|M|-|-|-|-|-)
MT-ID: 0
Algorithm: 0
SID: 6767
LS age: 471
Options: 0x22 (-|-|DC|-|-|-|E|-)
LS Type: Area-Local Opaque-LSA
Link State ID: 8.0.39.25 (Area-Local Opaque-Type/ID)
Opaque Type: 8
Opaque ID: 10009
Advertising Router: 3.3.3.3
LS Seq Number: 80000002
Checksum: 0x06c4
Length: 48
Link Type: 2
Link ID: 11.1.1.1
Link Data: 11.1.1.2
Flags: 0x60 (-|V|L|-|-|-|-|-)
MT-ID: 0
SID: 24321
LS age: 171
Options: 0x22 (-|-|DC|-|-|-|E|-)
LS Type: Area-Local Opaque-LSA
Link State ID: 8.0.39.30 (Area-Local Opaque-Type/ID)
Opaque Type: 8
Opaque ID: 10014
Advertising Router: 3.3.3.3
LS Seq Number: 80000002
Checksum: 0xf4af
Length: 52
Link Type: 2
Link ID: 12.1.1.2
Link Data: 12.1.1.2
Flags: 0x60 (-|V|L|-|-|-|-|-)
MT-ID: 0
NBR ID: 4.4.4.4
SID: 24322
Area-Local Opaque-LSA (Area 0.0.0.1)
LS age: 1601
Options: 0x22 (-|-|DC|-|-|-|E|-)
LS Type: Area-Local Opaque-LSA
Link State ID: 1.0.0.1 (Area-Local Opaque-Type/ID)
Opaque Type: 1
Opaque ID: 1
Advertising Router: 3.3.3.3
LS Seq Number: 80000002
Checksum: 0x36df
Length: 28
MPLS TE router ID : 3.3.3.3
Number of Links : 0
LS age: 1451
Options: 0x22 (-|-|DC|-|-|-|E|-)
LS Type: Area-Local Opaque-LSA
Link State ID: 1.0.0.12 (Area-Local Opaque-Type/ID)
Opaque Type: 1
Opaque ID: 12
Advertising Router: 3.3.3.3
LS Seq Number: 80000002
Checksum: 0xed55
Length: 108
Link connected to Broadcast network
Link ID : 10.1.1.1
Interface Address : 10.1.1.2
Admin Metric : 1
Maximum bandwidth : 10000000.00 Kbits/s
Maximum reservable bandwidth : 10000000.00 Kbits/s
Unreserved Bandwidth :
Number of Priority : 8
Priority 0 : 10000000.00 Kbits/s Priority 1 : 10000000.00 Kbits/s
Priority 2 : 10000000.00 Kbits/s Priority 3 : 10000000.00 Kbits/s
Priority 4 : 10000000.00 Kbits/s Priority 5 : 10000000.00 Kbits/s
Priority 6 : 10000000.00 Kbits/s Priority 7 : 10000000.00 Kbits/s
Number of Links : 1
LS age: 153
Options: 0x22 (-|-|DC|-|-|-|E|-)
LS Type: Area-Local Opaque-LSA
Link State ID: 4.0.0.0 (Area-Local Opaque-Type/ID)
Opaque Type: 4
Opaque ID: 0
Advertising Router: 3.3.3.3
LS Seq Number: 80000003
Checksum: 0x73c4
Length: 52
Range Size: 8000
Base-SID: 16000
Algorithm0: 0
Preference: 128
LS age: 861
Options: 0x22 (-|-|DC|-|-|-|E|-)
LS Type: Area-Local Opaque-LSA
Link State ID: 7.0.0.0 (Area-Local Opaque-Type/ID)
Opaque Type: 7
Opaque ID: 0
Advertising Router: 3.3.3.3
LS Seq Number: 80000003
Checksum: 0x6de1
Length: 92
Prefix type : Extended Prefix TLV
Route Type: 3
Prefix Length: 32
AF: 0
Flags: 0xc0 (A|N|-|-|-|-|-|-)
Address Prefix: 3.3.3.3
Flags: 0x08 (-|-|-|-|V|-|-|-)
MT-ID: 0
Algorithm: 0
SID: 18003
Prefix type : Extended Prefix TLV
Route Type: 3
Prefix Length: 32
AF: 0
Flags: 0x40 (-|N|-|-|-|-|-|-)
Address Prefix: 2.2.2.2
Flags: 0x48 (-|NP|-|-|V|-|-|-)
MT-ID: 0
Algorithm: 0
SID: 18002
Prefix type : Extended Prefix TLV
Route Type: 3
Prefix Length: 32
AF: 0
Flags: 0x40 (-|N|-|-|-|-|-|-)
Address Prefix: 4.4.4.4
Flags: 0x48 (-|NP|-|-|V|-|-|-)
MT-ID: 0
Algorithm: 0
SID: 18004
LS age: 153
Options: 0x22 (-|-|DC|-|-|-|E|-)
LS Type: Area-Local Opaque-LSA
Link State ID: 7.0.0.1 (Area-Local Opaque-Type/ID)
Opaque Type: 7
Opaque ID: 1
Advertising Router: 3.3.3.3
LS Seq Number: 80000001
Checksum: 0x6cb2
Length: 48
Prefix type : Extended Prefix Range TLV
Prefix Length: 32
AF: 0
Range: 3
Flags: 0x00 (-|-|-|-|-|-|-|-)
Address Prefix: 11.11.11.11
Flags: 0x20 (-|-|M|-|-|-|-|-)
MT-ID: 0
Algorithm: 0
SID: 1111
LS age: 153
Options: 0x22 (-|-|DC|-|-|-|E|-)
LS Type: Area-Local Opaque-LSA
Link State ID: 7.0.0.2 (Area-Local Opaque-Type/ID)
Opaque Type: 7
Opaque ID: 2
Advertising Router: 3.3.3.3
LS Seq Number: 80000001
Checksum: 0xe30a
Length: 48
Prefix type : Extended Prefix Range TLV
Prefix Length: 32
AF: 0
Range: 1
Flags: 0x00 (-|-|-|-|-|-|-|-)
Address Prefix: 12.12.12.12
Flags: 0x20 (-|-|M|-|-|-|-|-)
MT-ID: 0
Algorithm: 0
SID: 6767
LS age: 641
Options: 0x22 (-|-|DC|-|-|-|E|-)
LS Type: Area-Local Opaque-LSA
Link State ID: 8.0.39.20 (Area-Local Opaque-Type/ID)
Opaque Type: 8
Opaque ID: 10004
Advertising Router: 3.3.3.3
LS Seq Number: 80000002
Checksum: 0x01d1
Length: 48
Link Type: 2
Link ID: 10.1.1.1
Link Data: 10.1.1.2
Flags: 0x60 (-|V|L|-|-|-|-|-)
MT-ID: 0
SID: 24320
Validation for NLRI count
R3#sho bgp link-state link-state count
-------------------------------------------
Total NLRIs : 44
Node NLRIs : 11
Link NLRIs : 16
Prefix NLRIs : 17
Note: Count of NLRIs may be different sometimes.
R3#show bgp link-state link-state self-originate
BGP router identifier 3.3.3.3, local AS number 100
Origin codes: i - IGP, e - EGP
Prefix codes: E link, V node, T IP reacheable route, I Identifier
N local node, R remote node, L link, P prefix
L1/L2 ISIS level-1/level-2, O OSPF, a area-ID,
c confed-ID/ASN, b bgp-identifier, r router-ID,
i if-address, n nbr-address, o OSPF Route-type,
p IP-prefix, d designated router address, s ISO-ID
[V][O][I0x64][N[c100][b3.3.3.3][a0.0.0.0][r2.2.2.2]]/216
[V][O][I0x64][N[c100][b3.3.3.3][a0.0.0.0][r2.2.2.2d11.1.1.1]]/248
[V][O][I0x64][N[c100][b3.3.3.3][a0.0.0.0][r3.3.3.3]]/216
[V][O][I0x64][N[c100][b3.3.3.3][a0.0.0.0][r3.3.3.3d12.1.1.2]]/248
[V][O][I0x64][N[c100][b3.3.3.3][a0.0.0.0][r4.4.4.4]]/216
[V][O][I0x64][N[c100][b3.3.3.3][a0.0.0.1][r1.1.1.1]]/216
[V][O][I0x64][N[c100][b3.3.3.3][a0.0.0.1][r1.1.1.1d10.1.1.1]]/248
[V][O][I0x64][N[c100][b3.3.3.3][a0.0.0.1][r3.3.3.3]]/216
[E][O][I0x64][N[c100][b3.3.3.3][a0.0.0.0][r2.2.2.2][R[c100][b3.3.3.3][a0.0.0.0][r2.2.2.2d11.1.1.1]][L[i11.1.1.1][n11.1.1.1]]/376
[E][O][I0x64][N[c100][b3.3.3.3][a0.0.0.0][r2.2.2.2d11.1.1.1][R[c100][b3.3.3.3][a0.0.0.0][r2.2.2.2]][L[i11.1.1.1][n11.1.1.1]]/376
[E][O][I0x64][N[c100][b3.3.3.3][a0.0.0.0][r2.2.2.2d11.1.1.1][R[c100][b3.3.3.3][a0.0.0.0][r3.3.3.3]][L[i11.1.1.1][n11.1.1.2]]/376
[E][O][I0x64][N[c100][b3.3.3.3][a0.0.0.0][r3.3.3.3][R[c100][b3.3.3.3][a0.0.0.0][r2.2.2.2d11.1.1.1]][L[i11.1.1.2][n11.1.1.1]]/376
[E][O][I0x64][N[c100][b3.3.3.3][a0.0.0.0][r3.3.3.3][R[c100][b3.3.3.3][a0.0.0.0][r3.3.3.3d12.1.1.2]][L[i12.1.1.2][n12.1.1.2]]/376
[E][O][I0x64][N[c100][b3.3.3.3][a0.0.0.0][r3.3.3.3d12.1.1.2][R[c100][b3.3.3.3][a0.0.0.0][r3.3.3.3]][L[i12.1.1.2][n12.1.1.2]]/376
[E][O][I0x64][N[c100][b3.3.3.3][a0.0.0.0][r3.3.3.3d12.1.1.2][R[c100][b3.3.3.3][a0.0.0.0][r4.4.4.4]][L[i12.1.1.2][n12.1.1.1]]/376
[E][O][I0x64][N[c100][b3.3.3.3][a0.0.0.0][r4.4.4.4][R[c100][b3.3.3.3][a0.0.0.0][r3.3.3.3d12.1.1.2]][L[i12.1.1.1][n12.1.1.2]]/376
[E][O][I0x64][N[c100][b3.3.3.3][a0.0.0.1][r1.1.1.1][R[c100][b3.3.3.3][a0.0.0.1][r1.1.1.1d10.1.1.1]][L[i10.1.1.1][n10.1.1.1]]/376
[E][O][I0x64][N[c100][b3.3.3.3][a0.0.0.1][r1.1.1.1d10.1.1.1][R[c100][b3.3.3.3][a0.0.0.1][r1.1.1.1]][L[i10.1.1.1][n10.1.1.1]]/376
[E][O][I0x64][N[c100][b3.3.3.3][a0.0.0.1][r1.1.1.1d10.1.1.1][R[c100][b3.3.3.3][a0.0.0.1][r3.3.3.3]][L[i10.1.1.1][n10.1.1.2]]/376
[E][O][I0x64][N[c100][b3.3.3.3][a0.0.0.1][r3.3.3.3][R[c100][b3.3.3.3][a0.0.0.1][r1.1.1.1d10.1.1.1]][L[i10.1.1.2][n10.1.1.1]]/376
[T][O][I0x64][N[c100][b3.3.3.3][a0.0.0.0][r2.2.2.2]][P[0x1][p2.2.2.2/32]]/264
[T][O][I0x64][N[c100][b3.3.3.3][a0.0.0.0][r3.3.3.3]][P[0x1][p3.3.3.3/32]]/264
[T][O][I0x64][N[c100][b3.3.3.3][a0.0.0.0][r3.3.3.3]][P[0x2][p10.1.1.0/24]]/256
[T][O][I0x64][N[c100][b3.3.3.3][a0.0.0.0][r3.3.3.3]][P[0x2][p1.1.1.1/32]]/264
[T][O][I0x64][N[c100][b3.3.3.3][a0.0.0.0][r4.4.4.4]][P[0x1][p4.4.4.4/32]]/264
[T][O][I0x64][N[c100][b3.3.3.3][a0.0.0.1][r1.1.1.1]][P[0x1][p1.1.1.1/32]]/264
[T][O][I0x64][N[c100][b3.3.3.3][a0.0.0.1][r3.3.3.3]][P[0x0][p11.11.11.11/32]]/264
[T][O][I0x64][N[c100][b3.3.3.3][a0.0.0.1][r3.3.3.3]][P[0x0][p12.12.12.12/32]]/264
[T][O][I0x64][N[c100][b3.3.3.3][a0.0.0.1][r3.3.3.3]][P[0x2][p11.1.1.0/24]]/256
[T][O][I0x64][N[c100][b3.3.3.3][a0.0.0.1][r3.3.3.3]][P[0x2][p12.1.1.0/24]]/256
[T][O][I0x64][N[c100][b3.3.3.3][a0.0.0.1][r3.3.3.3]][P[0x2][p2.2.2.2/32]]/264
[T][O][I0x64][N[c100][b3.3.3.3][a0.0.0.1][r3.3.3.3]][P[0x2][p3.3.3.3/32]]/264
[T][O][I0x64][N[c100][b3.3.3.3][a0.0.0.1][r3.3.3.3]][P[0x2][p4.4.4.4/32]]/264
NLRIs, Total: 33, Node: 8, Link: 12, Prefix: 13
Note: Count of NLRIs may be different sometimes.
Note: Here the total number of NLRI increases because of prefixes configured in SRMS.
Validation for Particular NLRI
Here we verify the prefix-NLRIs for prefixes configured in SRMS.
R3#show bgp link-state link-state [T][O][I0x64][N[c100][b3.3.3.3][a0.0.0.1][r3.3.3.3]][P[0x0][p11.11.11.11/32]]/264
BGP routing table entry for [T][O][I0x64][N[c100][b3.3.3.3][a0.0.0.1][r3.3.3.3]][P[0x0][p11.11.11.11/32]]/264
Local
Received from IGP
Link State:
SRMS SID: Start: 1111 Range: 3 Algorithm: 0 SRMS Flags: IA:0
SR SID Flags: NP:0 M:1 E:0 V:0 L:0
Source Router ID:3.3.3.3
Local TE Router-ID:3.3.3.3