# Migrate LDP to SR (ISIS)

Load **basic.isis.ldp.enabled.cfg**

```
configure
load bootflash:basic.isis.ldp.enabled.cfg
commit replace
y
```

Currently the core is using LDP only. Convert the core to SR only without any traffic disruption.

## Answer <a href="#id-9bfc5f0e-8526-43e5-9234-8e06c1cd82ab" id="id-9bfc5f0e-8526-43e5-9234-8e06c1cd82ab"></a>

Step 1) We add SR to all nodes. By default, the LDP label will still be preferred, so this doesn’t result in any change in the data plane. Only R1 is shown for brevity:

```
#R1
router isis 1
 add ipv4
  segment-routing mpls
 int lo1
  add ipv4
   prefix-sid index 1
```

\
We can see that the SR label table is now populated:

<div align="left"><figure><img src="/files/uJIwPYHayQeA3WK0Fm9U" alt=""><figcaption></figcaption></figure></div>

SR to SR label swap entries have been added to the LFIB:

<div align="left"><figure><img src="/files/z178rSfx2cV4nVcw7yQJ" alt=""><figcaption></figcaption></figure></div>

However, none of these will be used right now, because all routers are still imposing LDP labels on IP packets. We can verify this by checking the FIB for any prefix:

<div align="left"><figure><img src="/files/6D9f2YYNdcbF6SvqRVpz" alt=""><figcaption></figcaption></figure></div>

Step 2) We change the label imposition to SR labels rather than LDP labels. This can be done on a router-by-router basis. Only R1 is shown for brevity:

```
#R1
router isis 1
 add ipv4
  segment-routing mpls sr-prefer
```

The label imposed is now the SR label:

<div align="left"><figure><img src="/files/ERtqpMTnjEDeD1ER01tm" alt=""><figcaption></figcaption></figure></div>

This can be done router-by-router with no issues. Only the ingress LER controls whether the LDP or SR label path is used. LSRs will switch SR labels to SR labels and LDP labels to LDP labels.

Step 3) Once all routers are imposing SR labels via the **sr-prefer** command, we can begin removing LDP. First we’ll remove LDP/IGP sync from the ISIS apply group. (If you remove LDP first, the IGP will be affected as the IGP costs will change).

```
#R1
group ISIS
 router isis '1'
  interface 'GigabitEthernet.*'
   address-family ipv4 unicast
    no mpls ldp sync
end-group
```

Step 4) Now we remove LDP from all routers one by one.

```
#R1
router isis 1
 add ipv4
  no mpls ldp auto-config
!
no mpls ldp
```

### Summary <a href="#id-17787acc-74af-4f30-afc9-526c00b04987" id="id-17787acc-74af-4f30-afc9-526c00b04987"></a>

Cisco’s default preference for LDP label imposition gives us a graceful way to migrate to SR. First, SR is enabled everywhere, but is not actually “in use” yet because LDP labels are still being imposed. This allows us to first verify SR and perhaps use OAM to verify SR LSPs before SR is actually used.

Next, we use **sr-prefer** to start enabling SR. This can be done on a router-by-router basis. The ingress LER controls whether an LDP or SR label is imposed. Make sure you have enabled SR everywhere before doing this.

Finally, we can remove LDP. We first removed LDP/IGP sync to prevent max-metrics on interfaces, and then removed LDP altogether.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ccie-sp.gitbook.io/ccie-spv5.1-labs/labs/sr/migrate-ldp-to-sr-isis.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
