# MSDP RPF Check (IOS-XR)

Load **inter-as.multicast.msdp.configured.cfg**

```
#IOS-XE
config replace flash:inter-as.multicast.msdp.configured.cfg
 
#IOS-XR
configure
load bootflash:inter-as.multicast.msdp.configured.cfg
commit replace
y
```

<figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2FQC7dJWnjlwqCY6rnnFJ3%2Fimage.png?alt=media&#x26;token=816e3579-e2e7-4391-bf87-480be650a962" alt=""><figcaption></figcaption></figure>



On XR2, explain why the RPF check for SAs originated by CSR9 (11.0.0.9) is via the MSDP peer that is used.



Using BGP tools, change this on XR2 to use the other MSDP peer.

















































## Answer <a href="#id-42a3909c-df22-4a82-a60f-f7a917dfaf06" id="id-42a3909c-df22-4a82-a60f-f7a917dfaf06"></a>

```
#XR2
route-policy SET_LP_110
  set local-preference 110
end-policy
!
router bgp 8
 ! This will depend on which peer is currently used for the RPF check
 neighbor 10.12.14.14
  address-family ipv4 multicast
   route-policy SET_LP_110 in
```



## Explanation <a href="#id-6cf29490-9b3c-4b2c-87c2-15e5b4923ce3" id="id-6cf29490-9b3c-4b2c-87c2-15e5b4923ce3"></a>

To view the current RPF MSDP peer for 11.0.0.9, we can use **show msdp rpf** on XR2.

<div align="left"><figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2F3ozBKL7jNozTXsCmN5kv%2Fimage.png?alt=media&#x26;token=c652d7f4-bd3f-4b3e-bc97-e5a66ec824bc" alt=""><figcaption></figcaption></figure></div>



Above, we see that CSR10 is the RPF MSDP peer, and that rule 4 is used. To understand why, let’s re-cap the MSDP RPF rules.



IOS-XR uses RFC3618 rules (not Cisco rules, as IOS-XE does by default).

1. MSDP peer = Originating RP
2. MSDP peer = BGP nexthop to the originating RP
3. MSDP peer = BGP peer which advertised the route towards the originating RP
4. MSDP peer resides in the closet AS towards the originating RP
5. MSDP peer RPF was statically configured (as with default-peer)



First, we can never match rule 1 for 11.0.0.9, because XR2 and CSR9 are not direct MSDP peers.



Next, we are not running BGP with the MSDP peers directly. Instead, XR2 runs BGP with XR4 and CSR6, so rule 2 and rule 3 will never be met.



Finally, rule 4 succeeds. The AS of each MSDP peer is found using a BGP lookup in ipv4/multicast (if available), and then ipv4/unicast. XR1 is not found in ipv4/multicast, but is found in ipv4/unicast via neighboring AS7.

<div align="left"><figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2FlVpR7i4okhsKyls1X3iN%2Fimage.png?alt=media&#x26;token=0de16338-3288-4fb4-8d77-5b9aefca1077" alt=""><figcaption></figcaption></figure></div>



CSR10 is found in ipv4/multicast via neighboring AS 9.

<div align="left"><figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2F5YCzP7lhGSXLj0508pjk%2Fimage.png?alt=media&#x26;token=4615a5db-a029-46db-97e3-a89d3b53764b" alt=""><figcaption></figcaption></figure></div>



Now XR2 checks the path to 11.0.0.9. If the best path is via AS9, then CSR10 should be used. If via AS7, then XR1 should be used.

<div align="left"><figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2FHtmzjfS9XYPALBTPAuwC%2Fimage.png?alt=media&#x26;token=85f949b0-9deb-4bbf-8ff1-b46a9d4d45e1" alt=""><figcaption></figcaption></figure></div>



We see above that the best path to 11.0.0.9 is via AS9, which is why CSR10 is used for the RPF check and uses rule 4.



To influence this we can simply use BGP tools to prefer the route for 11.0.0.9/32 via AS7.

```
#XR2
route-policy SET_LP_110
  set local-preference 110
end-policy
!
router bgp 8
 neighbor 10.12.14.14
  address-family ipv4 multicast
   route-policy SET_LP_110 in
```



Now that AS7 is the best path to 11.0.0.9, we should switch to using XR1 as the RPF MSDP peer.

<div align="left"><figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2Fky6YRqs36NMqQhwTOC8l%2Fimage.png?alt=media&#x26;token=abdfedb0-d547-406d-8050-cf3c3785c8d2" alt=""><figcaption></figcaption></figure></div>



Indeed that is the case:

<div align="left"><figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2FsirrpiTnv2Gq0A5WDPHG%2Fimage.png?alt=media&#x26;token=6535392a-f236-4bfe-ab3f-4c86b1a59419" alt=""><figcaption></figcaption></figure></div>



Note that, depending on how the lab loaded, you might have experienced the route via AS7 as best first due to being oldest. In that case you can just set LP inbound on the other peer, CSR6.
