MPLS VPN VRF Import Map


(Rene Molenaar) #1

This topic is to discuss the following lesson:


(Ignacio R) #2

Hello,

I lab a big scenario with almost everything explained in MPLS section. There are two customer each one with two sites. So my intention was to test Import and export maps, and Ì thought in this situation:

  • I wanted all routes from customer B site 1 to customer A site 2 be advertised and viceversa.
  • I wanted some connectivity between some routes (filtering with export maps) of customer A site 2 and customer B site 1

So my first failed attemp I tried this on R4

ip vrf AA
 rd 3:3
 export map PRUEBA
 route-target export 5:5
 route-target import 5:5
 route-target import 1:2
!
ip vrf BB
 rd 4:4
 route-target export 6:6
 route-target import 6:6
!
R4#sh route-map PRUEBA
route-map PRUEBA, permit, sequence 10
  Match clauses:
    ip address prefix-lists: OCHO
  Set clauses:
    extended community RT:2:1
  Policy routing matches: 0 packets, 0 bytes
R4#

but it was only exporting what the export map had, route-target export 5:5 was useless totally.

So I change to:

ip vrf AA
 rd 3:3
 export map EXPORTALL
 route-target import 5:5
 route-target import 1:2
!
ip vrf BB
 rd 4:4
 route-target export 6:6
 route-target import 6:6
!
route-map EXPORTALL, permit, sequence 5
  Match clauses:
    ip address prefix-lists: OCHO
  Set clauses:
    extended community RT:2:1 RT:5:5
  Policy routing matches: 0 packets, 0 bytes
route-map EXPORTALL, permit, sequence 10
  Match clauses:
  Set clauses:
    extended community RT:5:5
  Policy routing matches: 0 packets, 0 bytes

An it worked fine.

From R2, I found that both importmap and route-target statement are needed

ip vrf AA
 rd 1:1
 route-target export 5:5
 route-target import 5:5
!
ip vrf BB
 rd 2:2
 import map IMPORT
 route-target export 6:6
 route-target export 1:2
 route-target import 6:6
 route-target import 2:1
!
route-map IMPORT, permit, sequence 10
  Match clauses:
    ip address prefix-lists: OCHO2
    extcommunity (extcommunity-list filter):AA
  Set clauses:
  Policy routing matches: 0 packets, 0 bytes
route-map IMPORT, permit, sequence 20
  Match clauses:
    extcommunity (extcommunity-list filter):BB
  Set clauses:
  Policy routing matches: 0 packets, 0 bytes
route-map IMPORT, deny, sequence 30
  Match clauses:
  Set clauses:
  Policy routing matches: 0 packets, 0 bytes
R2#

For me my conclusion, correct me if I am wrong is that:

  • In export-map, when you used it, it make other route-target in configuration statement useless.
  • In import-maps both the import map and the route target are needed to work properly.
    Is there any other way to make this simplier? because I think there is no scalability in adding RT labels more and more.