# Inter-AS Option C w/ RT Rewrite

Load **inter.as.l3vpn.option.c.rt.rewrite.init.cfg**

```
#IOS-XE
config replace flash:inter.as.l3vpn.option.c.rt.rewrite.init.cfg
 
#IOS-XR
configure
load bootflash:inter.as.l3vpn.option.c.rt.rewrite.init.cfg
commit replace
y
```

<figure><img src="/files/S1MZGRK1Pqo7NZANvLVo" alt=""><figcaption></figcaption></figure>

Inter-AS option C is already fully setup. However, each SP is using its own RT values, and doesn’t want to have to import the other AS’s RT value on every single PE. Configure RT rewrite so that each PE can keep the same RT policy it has for each VRF.

## Answer <a href="#a6ed57aa-524c-4431-b50e-408a12365955" id="a6ed57aa-524c-4431-b50e-408a12365955"></a>

```
#R5
ip extcommunity-list standard VPN_A permit rt 200:1
ip extcommunity-list standard VPN_B permit rt 200:2
!
route-map XR2_INBOUND
 match extcomm VPN_A
 set extcommun rt 100:1
route-map XR2_INBOUND permit 20
 match extcomm VPN_B
 set extcommun rt 100:2
!
router bgp 100
 add vpnv4
  neighbor 20.20.20.20 route-map XR2_INBOUND in

#XR2
route-policy R5_INBOUND
  if extcommunity rt matches-any (100:1) then
    set extcommunity rt (200:1)
  endif
  if extcommunity rt matches-any (100:2) then
    set extcommunity rt (200:2)
  endif
end-policy
!
router bgp 200
 neighbor 5.5.5.5
  add vpnv4 uni
   route-policy R5_INBOUND in
```

## Explanation <a href="#id-4d1ebd1c-5109-40f8-80fa-b38c3e30444f" id="id-4d1ebd1c-5109-40f8-80fa-b38c3e30444f"></a>

As with inter-AS option B, inter-AS option C requires SPs to coordinate the RT values. This lab asks us to do a rewrite operation so that every PE doesn’t have to import the remote SP’s RT value. In the previous lab we did the rewrite operation on the ASBRs in option B. In this lab, we must do the rewrite operation on the RRs, because the RRs are directly peering over eBGP VPNv4.

The rewrite operation uses the same route-map and RPL as we saw in the previous lab. The only difference is where we apply it. Verification is the same as in the previous option B lab, so we won’t cover it again here.


---

# 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/inter-as-l3vpn/inter-as-option-c-w-rt-rewrite.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.
