The following example shows the egress ASBR configuration to replace a route target (RT) with a VPN distinguisher, and shows the ingress ASBR configuration to replace the VPN distinguisher with a route target.
On the egress ASBR, IP extended community list 1 is configured to filter VPN routes by permitting only routes with RT 101:100. A route map named vpn-id-map1 says that any route that matches on routes that are allowed by IP extended community list 1 are subject to two
set commands. The first
set command deletes the RT from the route. The second
set command sets the VPN distinguisher attribute to 111:100.
The
route-map vpn-id-map1 permit 20 command allows other routes, which are not part of the RT-to-VPN distinguisher mapping, to pass the route map so that they are not discarded. Without this command, the implicit deny would cause these routes to be discarded.
Finally, in autonomous system 2000, for the VPNv4 address family, the route map vpn-id-map1 is applied to routes going out to the neighbor at 192.168.101.1.
Egress ASBR
ip extcommunity-list 1 permit rt 101:100
!
route-map vpn-id-map1 permit 10
match extcommunity 1
set extcomm-list 1 delete
set extcommunity vpn-distinguisher 111:100
!
route-map vpn-id-map1 permit 20
!
router bgp 2000
neighbor 192.168.101.1 remote-as 2000
address-family vpnv4
neighbor 192.168.101.1 activate
neighbor 192.168.101.1 route-map vpn-id-map1 out
exit-address-family
!
On the ingress ASBR, IP extended community list 51 allows routes with a VPN distinguisher of 111:100. A route map named vpn-id-rewrite-map1 says that any route that matches on routes that are allowed by IP extended community list 51 are subject to two
set commands. The first
set command deletes the VPN distinguisher from the route. The second
set command sets the RT to 101:1, and that RT is added to the RT list without replacing any RTs.
The
route-map vpn-id-rewrite-map1 permit 20 command allows other routes, which are not part of the VPN distinguisher-to-RT mapping, to pass the route map so that they are not discarded. Without this command, the implicit deny would cause those routes to be discarded.
Finally, in autonomous system 3000, for the VPNv4 address family, the route map named vpn-id-rewrite-map1 is applied to incoming routes destined for the neighbor at 192.168.0.81.
Ingress ASBR
ip extcommunity-list 51 permit vpn-distinguisher 111:100
!
route-map vpn-id-rewrite-map1 permit 10
match extcommunity 51
set extcomm-list 51 delete
set extcommunity rt 101:1 additive
!
route-map vpn-id-rewrite-map1 permit 20
!
router bgp 3000
neighbor 192.168.0.81 remote-as 3000
address-family vpnv4
neighbor 192.168.0.81 activate
neighbor 192.168.0.81 route-map vpn-id-rewrite-map1 in
exit-address-family
!