# 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="/files/MvnmQmUDAmKLP9Zw2yeZ" 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="/files/pLSX3RXP3ApOSRDKWcaH" 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="/files/SlSyqpTQZlkJRdfMvg3n" 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="/files/VWVKL9NJzjbD7XUlDsmw" 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="/files/eFTstF8A3rSCHDSFz6yA" 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.


---

# 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/multicast/interdomain-mbgp-policies.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.
