Option B is already fully setup. But the SPs do not want to import each other’s RT values on every single PE. Currently the inter-AS L3VPN traffic is not working because of this. Use RT rewrite on the ASBRs to fix this.
Answer
#R1
ip extcommunity-list standard VPN_A permit rt 200:1
ip extcommunity-list standard VPN_B permit rt 200:2
!
route-map XR1_INBOUND
match extcommunity VPN_A
set extcommunity rt 100:1
route-map XR1_INBOUND permit 20
match extcommunity VPN_B
set extcommunity rt 100:2
!
router bgp 100
add vpnv4
neighbor 30.1.19.19 route-map XR1_INBOUND in
#XR1
route-policy R1_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 30.1.19.1
add vpnv4 uni
route-policy R1_INBOUND in
Explanation/Verification
Inter-AS option B requires coordination of RT values between the SPs. In this lab, the SPs do not want to have to import the other SP’s RT value on every single VRF of every PE. Instead, we are asked to configure an RT rewrite policy on the ASBRs.
On R1, we identify the two RT values that AS200 uses for VPN_A and VPN_B. We then set this to our own RT value for these VPNs. This is applied to the neighbor XR1 inbound.
#R1
ip extcommunity-list standard VPN_A permit rt 200:1
ip extcommunity-list standard VPN_B permit rt 200:2
!
route-map XR1_INBOUND
match extcommunity VPN_A
set extcommunity rt 100:1
route-map XR1_INBOUND permit 20
match extcommunity VPN_B
set extcommunity rt 100:2
!
router bgp 100
add vpnv4
neighbor 30.1.19.19 route-map XR1_INBOUND in
On R2, we now see that remote VPNv4 updates have the RT of 100:1 instead of 200:1. This allows R2 to import the routes without any changes on R2 itself.
We do the same on XR1, matching the remote AS’s RT values and translating these to AS200’s RT value.
#XR1
route-policy R1_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 30.1.19.1
add vpnv4 uni
route-policy R1_INBOUND i
This allows XR2 to import the VPNv4 routes without any changes.
Note that there was no need to alter the RD values, as these are just used to keep VPNv4 updates separated in the global VPNv4 table.