# PIM-SM with BSR for IPv6

Load **multicast.init.cfg**

```
#IOS-XE
config replace flash:multicast.init.cfg
 
#IOS-XR
configure
load bootflash:multicast.init.cfg
commit replace
y
```

* Configure R9 and XR4 as RPs for all IPv6 groups using BSR.
  * Both R9 and XR4 should be BSRs as well.
  * R9 should be the preferred BSR and Candidate RP.

## Answer <a href="#id-08b045e9-e80a-4102-8d6e-f8a7995ab72f" id="id-08b045e9-e80a-4102-8d6e-f8a7995ab72f"></a>

```
#XR4
multicast-routing
 address-family ipv6
  interface Loopback0 enable
!
router pim
 address-family ipv6
  bsr candidate-bsr 2001::14
  bsr candidate-rp 2001::14

#R9
ipv6 pim bsr candidate bsr 2001::9 priority 2
ipv6 pim bsr candidate rp 2001::9
```

## Explanation <a href="#d0f3a097-9a9e-4652-a13b-6d743b57ee11" id="d0f3a097-9a9e-4652-a13b-6d743b57ee11"></a>

BSR for IPv6 works very much the same as BSR for IPv4. There is a minor difference with the default priority values for IOS-XE, though. IOS-XE conforms to the RFC standard and uses priority 192 for the C-RP advertisement.

Just like for IPv4 BSR, IOS-XE uses a default BSR priority value of 0, and IOS-XE uses a default BSR priority value of 1. For this reason, we specify priority value 2 on R9 so that it will be the elected BSR.

```
#R9
ipv6 pim bsr candidate bsr 2001::9 priority 2
```

On R9 we can see that it has won the BSR election and that it has an RP-cache consisting of both 2001::9 and 2001::14 for ff00::/8.

<div align="left"><figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2FkNAQFaXugkDj9kXgy6aV%2Fimage.png?alt=media&#x26;token=a8dcfd96-5866-47a0-90e9-0ded1ee2bf22" alt=""><figcaption></figcaption></figure></div>

On any other router, the “show ipv6 pim bsr rp-cache” command will show nothing. This is only useful on the BSR itself. However, we can see the IPv6 PIM RP mapping using the following command.

<div align="left"><figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2F87jWHTqWWNAS6y9dItcP%2Fimage.png?alt=media&#x26;token=c362f872-b35f-4a52-9612-521f08dac0bb" alt=""><figcaption></figcaption></figure></div>

Using the command **show ipv6 pim group-map \<group address>** we can see which RP wins the election. When the priories tie, the hash mask length is used just like with IPv4 BSR. We can see the hash mask length value using **show ipv6 pim bsr election**. This is 126 by default.

<div align="left"><figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2FEwqt51BMYEy2ab0jEkqE%2Fimage.png?alt=media&#x26;token=89ee8648-1313-4ea2-9442-04284be62f05" 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%2Fv6R9iiYffXi9atUuZ86T%2Fimage.png?alt=media&#x26;token=bf453ba4-ff93-43ef-b9ea-36549e630498" 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%2FDXJzyNeemNHozykBUymm%2Fimage.png?alt=media&#x26;token=76cbdec2-ee10-4cb6-a259-49f3a819c344" alt=""><figcaption></figcaption></figure></div>

Strangely, I can never get 2001::14 to be used.

Similar commands can be used on IOS-XR. Interestingly, I can get XR3 to use XR4 as an RP for some groups. This appears to be a bug in IOS-XE.

<div align="left"><figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2FSvTuPEHPcZ2p1XKP3zSd%2Fimage.png?alt=media&#x26;token=8b7ab804-93b8-4901-933a-6a0547e74bcb" 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%2F9G0zmZp48uFwB3iuk4gG%2Fimage.png?alt=media&#x26;token=26347fd4-0357-4f19-8718-3ff5d56e7b6f" 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%2FBJR4LGQ6isb6CXyx6YMg%2Fimage.png?alt=media&#x26;token=7eb909b8-0fae-43fe-80e7-2b255bea56ad" alt=""><figcaption></figcaption></figure></div>

### Failover Considerations <a href="#id-000cb627-9bd3-4bff-b1ad-bd39ac796018" id="id-000cb627-9bd3-4bff-b1ad-bd39ac796018"></a>

Failover does not appear to be as robust with IPv6 PIM. When I shutdown Lo0 on R9, I don’t see automatic failover on all other routers. In fact, R9 continues caching itself as C-RP in **show ipv6 pim bsr rp-cache** output. R9 stops sending BSR messages so its boot strap messages eventually time out on all other routers, and all routers are left with no RPs at all. Next, XR4 elects itself as BSR and floods its RP mapping with only itself as C-RP. Other downstream routers learn this. But there was a period of time when some routers had no RP information at all in my lab.
