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.

(Rene Molenaar) #3

Hello Ignacio,

In export-map, when you used it, it make other route-target in configuration statement useless.

That sounds correct, I noticed the same behavior in my MPLS VPN export map example.

In import-maps both the import map and the route target are needed to work properly.

That sounds right too. Even with the import-map, you still see the VPN routes. The import map influences the VPN routes you import into the VRF.

Is there any other way to make this simpler? because I think there is no scalability in adding RT labels more and more.

Hmm I don’t think there is but you probably could do most of the work with the export-maps and regular route-target import commands. For simple sites where you don’t differentiate between the prefixes, you can use a single RT to export everything. Another site can import everything with a single RT.

For sites with multiple prefixes and you want to define who gets to import these prefixes, you must use an export-map to set different RTs per prefix. You can import them with the regular route-target import command.

Rene