# Interdomain MBGP Policies

Load **inter-as.multicast.mbgp.policy.init.cfg**

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



R3 has joined group 236.1.1.1. Ping this from R4. Traffic is flowing via AS11 - AS7 - AS8, because R9 has prepended multicat routes towards AS9.

<figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2Fdbz9xkcZPsC3NDTEDOaq%2Fimage.png?alt=media&#x26;token=a474a080-e74e-43ef-b4c4-8b83b9380cf0" alt=""><figcaption></figcaption></figure>



However, AS7 has decided that it does not wish to become a transit AS. Implement BGP policy so that AS7 is not used for transit IPv4 multicast traffic.

















































## Answer <a href="#a40958dd-b3bc-43dd-bebd-3fc1beef0e50" id="a40958dd-b3bc-43dd-bebd-3fc1beef0e50"></a>

```
#XR1
route-policy MBGP_EBGP_OUT
  if as-path in (ios-regex '^$') then
    pass
  endif
end-policy
!
router bgp 7
 neighbor 10.10.11.10
  add ipv4 multicast
   route-policy MBGP_EBGP_OUT out

#XR4
route-policy MBGP_EBGP_OUT
  if as-path in (ios-regex '^$') then
    pass
  endif
end-policy
!
router bgp 7
 neighbor 10.9.14.9
  add ipv4 multicast
   route-policy MBGP_EBGP_OUT out
 neighbor 10.12.14.12
  add ipv4 multicast
   route-policy MBGP_EBGP_OUT out
```



## Explanation <a href="#cdd1e1e4-e508-47ab-b195-15b1b3df9e03" id="cdd1e1e4-e508-47ab-b195-15b1b3df9e03"></a>

Before making any changes, we’ll explore the current state of the inter-domain multicast routing. Ping the group 236.1.1.1 from R4.

```
#R4
ping 236.1.1.1
```



R9 sources SA MSDP messages to its peers. XR2 finds that it has interested receivers for (\*, 236.1.1.1), and joins a (S, G) rooted at R4. XR2 uses the interface towards XR4 as the RPF interface:

<div align="left"><figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2FOcPp0NVpz6NY4UVUvLrU%2Fimage.png?alt=media&#x26;token=08e6edf9-d716-4a1d-9dd3-99600019d361" alt=""><figcaption></figcaption></figure></div>



The reason for this is that the RPF table uses the multicast BGP routes by default, and the best path to 11.4.13.4 is via XR4. This is because R9 is prepending advertisements towards AS9. So AS9’s best path is also via AS7.

<div align="left"><figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2FVBc6Kv2yGWhS2hkUMtnY%2Fimage.png?alt=media&#x26;token=4aaea178-0339-47ab-8f1d-07a6e194f42e" alt=""><figcaption></figcaption></figure></div>



AS7 has decided that it does not want to provide transit IPv4 multicast delivery between other ASs. This is the same idea behind a multihomed internet customer not wanting to become transit for IPv4 unicast traffic. AS7 can simply apply an outbound policy that only permits locally-originated routes.

```
#XR1
route-policy MBGP_EBGP_OUT
  if as-path in (ios-regex '^$') then
    pass
  endif
end-policy
!
router bgp 7
 neighbor 10.10.11.10
  add ipv4 multicast
   route-policy MBGP_EBGP_OUT out

#XR4
route-policy MBGP_EBGP_OUT
  if as-path in (ios-regex '^$') then
    pass
  endif
end-policy
!
router bgp 7
 neighbor 10.9.14.9
  add ipv4 multicast
   route-policy MBGP_EBGP_OUT out
 neighbor 10.12.14.12
  add ipv4 multicast
   route-policy MBGP_EBGP_OUT out
```



The network reconverges, and only one route is left via AS9:

<div align="left"><figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2F8oNve2MqAFKeTQIifut5%2Fimage.png?alt=media&#x26;token=26cd59e4-47c0-463f-bc4a-03cf243d07e2" alt=""><figcaption></figcaption></figure></div>



Since the RPF check for the source 11.4.13.4 resolves to 10.6.12.6, this is used to source the PIM Join. The multicast traffic now flows via AS9-AS11-AS8:

<div align="left"><figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2FFNJ23rIN1YRKKUCoZGIO%2Fimage.png?alt=media&#x26;token=07430c4f-2f8d-4d8e-9267-e417cd5ab68c" alt=""><figcaption></figcaption></figure></div>



This lab demonstrates the use of BGP ipv4/multicast. It is only used for RPF checks for inter-domain multicast sources. The RPF interface determines how the multicast traffic will flow, because the PIM Join for the (S, G) is only sent out the RPF interface. The receiving router will add the interface receiving the PIM Join to its OIL. So the BGP ipv4/multicast routes control the topology of the distribution tree. BGP ipv4/multicast allows you to create a topology that is non-congruent with unicast routes. If you are OK with inter-domain multicast using the unicast table for RPF checks, there’s no need to even run BGP ipv4/multicast.
