This document helps to configure higher preference for SR (segment routing) over LDP.
Topology:
R1(1.1.1.1) --------ISIS,SR,LDP------------R3(3.3.3.3)
R1 is learning R3's loopback 3.3.3.3 via SR as well as LDP.
By default, LDP route is preferred.
inet.0: 22 destinations, 22 routes (22 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 3.3.3.3/32 *[IS-IS/18] 00:12:33, metric 10 > to 20.20.20.2 via ge-0/0/1.0 inet.3: 5 destinations, 8 routes (5 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 3.3.3.3/32 *[LDP/9] 00:07:35, metric 1 > to 20.20.20.2 via ge-0/0/1.0 [L-ISIS/14] 00:04:16, metric 10 > to 20.20.20.2 via ge-0/0/1.0, Push 0
Add below configuration to get SR route preferred over LDP:
set protocols isis level 1 labeled-preference 8
After adding above config:
inet.0: 22 destinations, 22 routes (22 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 3.3.3.3/32 *[IS-IS/18] 00:00:08, metric 10 > to 20.20.20.2 via ge-0/0/1.0 inet.3: 5 destinations, 8 routes (5 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 3.3.3.3/32 *[L-ISIS/8] 00:00:08, metric 10 > to 20.20.20.2 via ge-0/0/1.0, Push 0 [LDP/9] 00:00:08, metric 1 > to 20.20.20.2 via ge-0/0/1.0