# SR Basic Inter-IGP (redistribution)

Load **sr.inter.igp.init.cfg**

```
configure
load bootflash:sr.inter.igp.init.cfg
commit replace
y
```



ISIS and OSPF are already pre-configured as shown in the diagram below. R3 is running both ISIS and OSPF.

<figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2FvkscYkNmfeMIeIps9gd5%2Fimage.png?alt=media&#x26;token=c83538be-70ff-45e0-b161-1babc162977c" alt=""><figcaption></figcaption></figure>



Configure mutual redistribution between ISIS and OSPF so that PEs such as R2 and R8 can form an end-to-end LSP.













































## Answer <a href="#id-5867e214-6868-4af1-bf3f-8e12475c3135" id="id-5867e214-6868-4af1-bf3f-8e12475c3135"></a>

```
#R3
route-policy LOOPBACKS
 if destination in (0.0.0.0/0 le 32) then pass endif
end-policy
!
router ospf 1
 redistribute isis 1 route-policy LOOPBACKS
 area 0
  interface Loopback1
   prefix-sid index 3
!
router isis 1
 add ipv4 uni
   redistribute ospf 1 route-policy LOOPBACKS
```



## Explanation <a href="#id-99af5ad8-b3ab-4810-955f-4e4342c536d8" id="id-99af5ad8-b3ab-4810-955f-4e4342c536d8"></a>

Simply redistributing prefixes between IGPs or between an IGP and BGP will automatically cause the prefix SID to be advertised with it. This is because the RIB drives the redistribution, and the label for the prefix is present in the RIB. SR automatically captures this label, converts it to the index number, and advertises it into the other protocol. For this to work, both protocols must have the same SRGB. If they do not, the prefix is still redistributed of course, but the prefix SID is not included.



Also note that, because the RIB drives the prefix SID advertisement, the local ASBR’s loopback must be natively advertised into both protocols. I’ve removed this from R3 so that it is not advertising Lo1 into OSPF directly right now. The redistribution of ISIS into OSPF catches Lo1 because it is locally advertised into ISIS. We can see that R7 knows the route to 3.3.3.1/32. However, there is no label associated with it.

<div align="left"><figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2FgJGujQD8YsXmEJzyPWQ4%2Fimage.png?alt=media&#x26;token=7e650adb-1c95-4bae-9165-1c36ee5515fa" alt=""><figcaption></figcaption></figure></div>



Instead, we must natively advertise the loopback into all protocols on the ASBR.

```
#R3
router ospf 1
 area 0
  interface Loopback1
   prefix-sid index 3
!
router isis 1
 interface Loopback1
  address-family ipv4 unicast
   prefix-sid index 3
```



R7 now has a route for the prefix with an SR label:

<div align="left"><figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2FdeClSzPRNCogUaPJfLMO%2Fimage.png?alt=media&#x26;token=19f8268c-e149-4bfb-bc31-c8f1aed4e786" alt=""><figcaption></figcaption></figure></div>



Let’s follow how a prefix is advertised from ISIS to OSPF. We’ll look at 2.2.2.1/32. This is present in the RIB of R3 via ISIS with a label:

<div align="left"><figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2FPUJn9EwYJQsSEPxfSnSL%2Fimage.png?alt=media&#x26;token=7208ca43-f903-4788-939d-b35fa97ede8f" alt=""><figcaption></figcaption></figure></div>



When R3 redistributes ISIS into OSPF, the label is gathered from the RIB and converted to an index because the SRGB of ISIS and OSPF match. R3 then injects this as an OSPF E2 prefix (type 5 LSA) as usual, and also generates a corresponding Opaque External Prefix LSA with type 11 (domain-wide flooding). Note that this is one of the few times you will see an Opaque-AS (type 11) LSA instead of Opaque-area (type 10).

<div align="left"><figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2FmvqwcanXYKDnmmK5E1Wv%2Fimage.png?alt=media&#x26;token=eef77009-cd5f-495a-bf60-ae26cac412ed" alt=""><figcaption></figcaption></figure></div>

<div align="left"><figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2FqkNQaWhXsE4gXmt5SJ29%2Fimage.png?alt=media&#x26;token=47c002e4-d65a-4382-83fc-7f5a7edcd2ea" alt=""><figcaption></figcaption></figure></div>



Above, the flags 0x40 mean that only the No-PHP flag is set. This is the same as with inter-area SR: the ABR (ASBR in this case) sets the No-PHP flag because it is not the ultimate hop for the prefix.



Let’s now follow redistribution from OSPF into ISIS. We’ll examine 8.8.8.1/32. This is present in the RIB of R3 via OSPF with a label:

<div align="left"><figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2F2R0GMjJ1KWwuyA1Gjcz9%2Fimage.png?alt=media&#x26;token=61fd11de-a012-492d-b1ee-3adc8216342b" alt=""><figcaption></figcaption></figure></div>



R3 advertises this into its ISIS L2 LSP as an Extended IP prefix, with an associated Prefix SID index value. The R flag is set (re-advertisement) as well as the PHP-Off flag, because R3 is not the ultimate node for the prefix. The X flag (external) is also set, but this is not related to SR, it is normal ISIS behavior when redistributing prefixes.

<div align="left"><figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2FrKOt3Jjpgk8zeZYB0ZbA%2Fimage.png?alt=media&#x26;token=8c36173c-7700-4a3a-9821-06eaeb8e8071" alt=""><figcaption></figcaption></figure></div>



R2 and R8 now have an end-to-end LSP. We’ll enable **mpls oam** on all nodes to confirm:

<div align="left"><figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2FwAgzZeGHHdHCV0w4RngW%2Fimage.png?alt=media&#x26;token=e2269eac-0648-4628-a3b0-e790adefdded" alt=""><figcaption></figcaption></figure></div>

<div align="left"><figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2FZiyESNQ47sWzNSB1fkZm%2Fimage.png?alt=media&#x26;token=86499adf-151b-48fe-b602-9907730edbfc" alt=""><figcaption></figcaption></figure></div>
