vrf IMPORT-MAP

vrf IMPORT-MAP only filters, still need to use route-target import to bring routes into BGP table

en
conf t
host R1
int f0/0
ip add 1.1.1.1 255.255.255.0
no shut
router bgp 1
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 1.1.1.2 remote-as 1
!
address-family vpnv4
neighbor 1.1.1.2 activate
neighbor 1.1.1.2 send-community both
exit-address-family
!
address-family ipv4 vrf R1
redistribute connected
no synchronization
exit-address-family

ip vrf R1
rd 10:10
route-target export 200:200

int loop 20
ip vrf forwarding R1
ip address 30.30.30.1 255.255.255.255

ip vrf R2
rd 20:20
route-target export 100:100

int loop 30
ip vrf forwarding R2
ip add 20.20.20.1 255.255.255.255

int loop40
ip vrf forwarding R2
ip add 40.40.40.1 255.255.255.255

en
conf t
host R2
int f0/0
ip add 1.1.1.2 255.255.255.0
no shut
router bgp 1
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 1.1.1.1 remote-as 1
!
address-family vpnv4
neighbor 1.1.1.1 activate
neighbor 1.1.1.1 send-community both
exit-address-family

ip vrf R1
rd 10:10
import map IMPORT_RT_100_100
route-target import 100:100
route-target import 200:200

import map IMPORT_RT_100_100

ip extcommunity-list 1 permit rt 100:100

ip prefix-list IMPORT_RT_100_100 seq 5 permit 20.20.20.1/32

route-map IMPORT_RT_100_100 permit 10
match ip address prefix-list IMPORT_RT_100_100
match extcommunity 1

R2(config-route-map)#do sh bgp vpnv4 unicast rd 10:10
BGP table version is 49, local router ID is 1.1.1.2
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale
Origin codes: i – IGP, e – EGP, ? – incomplete

Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 10:10 (default for vrf R1)
*>i20.20.20.1/32 1.1.1.1 0 100 0 ?
*>i30.30.30.1/32 1.1.1.1 0 100 0 ?

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s