SR ISIS
1
router isis 12
is-type level-2-only3
net 49.0000.0000.0001.004
address-family ipv4 unicast5
metric-style wide6
segment-routing mpls7
!8
interface Loopback09
address-family ipv4 unicast10
prefix-sid index 111
!SR OSPF
1
router ospf 12
router-id 10.1.2.23
segment-routing mpls4
redistribute isis 1 route-policy Loopback5
address-family ipv4 unicast6
area 07
interface Loopback08
passive enable9
prefix-sid index 2SR BGP
1
route-policy SID($SID)2
set label-index $SID3
end-policy4
!5
router bgp 46
bgp router-id 10.1.4.47
address-family ipv4 unicast8
network 10.1.4.4/32 route-policy SID(4)9
allocate-label all10
!11
neighbor 10.1.45.512
remote-as 513
address-family ipv4 labeled-unicast14
route-policy pass in15
route-policy pass out16
!17
!18
!SR 路由重分发案例
使用router-policy只重分发Loopback (/32 prefix)。
1
route-policy Loopback2
if destination in (0.0.0.0/0 eq 32) then3
pass4
else5
drop6
endif7
end-policy8
9
address-family ipv4 unicast10
redistribute xx 1 route-policy LoopbackISIS
1
RP/0/0/CPU0:R1#show isis database R2.00-00 detail verbose 2
Tue Nov 12 12:26:08.786 UTC3
4
IS-IS 1 (Level-2) Link State Database5
LSPID LSP Seq Num LSP Checksum LSP Holdtime/Rcvd ATT/P/OL6
R2.00-00 0x0000021a 0x9162 380 /1199 0/0/07
Area Address: 498
Metric: 10 IS-Extended R1.009
Interface IP Address: 10.1.12.210
Neighbor IP Address: 10.1.12.111
Link Maximum SID Depth: 12
Subtype: 1, Value: 1013
ADJ-SID: F:0 B:0 V:1 L:1 S:0 P:0 weight:0 Adjacency-sid:2400114
NLPID: 0xcc15
IP Address: 10.1.2.216
Metric: 10 IP-Extended 10.1.2.2/3217
Prefix-SID Index: 2, Algorithm:0, R:0 N:1 P:0 E:0 V:0 L:018
Prefix Attribute Flags: X:0 R:0 N:119
Metric: 0 IP-Extended 10.1.3.3/3220
Prefix-SID Index: 3, Algorithm:0, R:1 N:0 P:1 E:0 V:0 L:021
Prefix Attribute Flags: X:1 R:0 N:022
Metric: 0 IP-Extended 10.1.4.4/3223
Prefix-SID Index: 4, Algorithm:0, R:1 N:0 P:1 E:0 V:0 L:024
Prefix Attribute Flags: X:1 R:0 N:025
Metric: 10 IP-Extended 10.1.12.0/2426
Prefix Attribute Flags: X:0 R:0 N:027
Metric: 0 IP-Extended 10.1.5.5/3228
Prefix-SID Index: 5, Algorithm:0, R:1 N:0 P:1 E:0 V:0 L:029
Prefix Attribute Flags: X:1 R:0 N:030
Hostname: R231
Router Cap: 10.1.2.2, D:0, S:032
Segment Routing: I:1 V:0, SRGB Base: 16000 Range: 800033
SR Algorithm: 34
Algorithm: 035
Algorithm: 136
Node Maximum SID Depth: 37
Subtype: 1, Value: 10OSPF
1
RP/0/0/CPU0:R2#show ospf database opaque-as 7.0.0.1 2
Tue Nov 12 12:32:53.108 UTC3
4
5
OSPF Router with ID (10.1.2.2) (Process ID 1)6
7
Type-11 Opaque Link AS Link States8
9
LS age: 65110
Options: (No TOS-capability, DC)11
LS Type: Opaque AS Link12
Link State ID: 7.0.0.113
Opaque Type: 714
Opaque ID: 115
Advertising Router: 10.1.2.216
LS Seq Number: 800000d017
Checksum: 0x9b1218
Length: 4419
20
Extended Prefix TLV: Length: 2021
Route-type: 522
AF : 023
Flags : 0x024
Prefix : 10.1.1.1/3225
26
SID sub-TLV: Length: 827
Flags : 0x4028
MTID : 029
Algo : 030
SID Index : 131
32
LS age: 35933
Options: (No TOS-capability, DC)34
LS Type: Opaque AS Link35
Link State ID: 7.0.0.136
Opaque Type: 737
Opaque ID: 138
Advertising Router: 10.1.4.439
LS Seq Number: 800000d040
Checksum: 0x564741
Length: 4442
43
Extended Prefix TLV: Length: 2044
Route-type: 545
AF : 046
Flags : 0x047
Prefix : 10.1.5.5/3248
49
SID sub-TLV: Length: 850
Flags : 0x4051
MTID : 052
Algo : 053
SID Index : 554
55
RP/0/0/CPU0:R2# BGP
1
RP/0/0/CPU0:R5#show route 10.1.4.4/322
Tue Nov 12 12:24:39.372 UTC3
4
Routing entry for 10.1.4.4/325
Known via "bgp 5", distance 20, metric 0, [ei]-bgp, labeled unicast (3107), labeled SR6
Tag 4, type external7
Installed Nov 7 16:44:44.757 for 4d19h8
Routing Descriptor Blocks9
10.1.45.4, from 10.1.45.4, BGP external10
Route metric is 011
No advertising protos. 12
RP/0/0/CPU0:R5#show bgp ipv4 labeled-unicast 10.1.4.4/3213
Tue Nov 12 12:25:15.710 UTC14
BGP routing table entry for 10.1.4.4/3215
Versions:16
Process bRIB/RIB SendTblVer17
Speaker 7 718
Local Label: 1600419
Last Modified: Nov 7 16:44:44.269 for 4d19h20
Paths: (1 available, best #1)21
Not advertised to any peer22
Path #1: Received by speaker 023
Not advertised to any peer24
425
10.1.45.4 from 10.1.45.4 (10.1.4.4)26
Received Label 3 27
Origin IGP, metric 0, localpref 100, valid, external, best, group-best, labeled-unicast28
Received Path ID 0, Local Path ID 1, version 729
Origin-AS validity: (disabled)30
Prefix SID Attribute Size: 731
Label Index: 4
This Blog From Xuxing's Blog;