Importing VRF to another VRF with route-target command not working

Keith Copeland
Keith Copeland used Ask the Experts™
on
Hi,

I am trying to test out VRF lite which I have to implement. I have a single router with some loopback addresses in different VRFs. What I am trying to do is to import and export routes between them which I should be able to do with the route import / export command but I am not having any luck.

I know this makes no logical sense to why I am doing it but I need to test this before I implement it in a production network (with many VRFs).

version 15.5
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Test-DC
!

boot-start-marker

boot-end-marker

!

!

no aaa new-model

!

!


clock timezone EET 2 0

mmi polling-interval 60

no mmi auto-configure

no mmi pvc

mmi snmp-timeout 180

!

!

ip vrf Customer_A

rd 10:10

route-target export 10:10

route-target import 10:10

route-target import 10:20

!

ip vrf Customer_B

rd 10:20

route-target export 10:20

route-target import 10:10

route-target import 10:20

!

!

ip cef

no ipv6 cef

!

multilink bundle-name authenticated

!

!

cts logging verbose

!

!

redundancy

!

!

interface Loopback0

ip vrf forwarding Customer_A

ip address 172.18.7.254 255.255.255.0

!

interface Loopback1

ip vrf forwarding Customer_A

ip address 172.18.253.254 255.255.255.0

!

interface Loopback3

ip vrf forwarding Customer_B

ip address 192.168.17.254 255.255.255.0

!

interface Ethernet0/0

no ip address

!

interface Ethernet0/0.10

encapsulation dot1Q 10

ip vrf forwarding Customer_A

ip address 172.18.254.254 255.255.255.0

!

interface Ethernet0/0.20

encapsulation dot1Q 20

ip vrf forwarding Customer_B

ip address 192.168.15.254 255.255.255.0

!

interface Ethernet0/1

no ip address

shutdown

!

interface Ethernet0/2

no ip address

shutdown

!

interface Ethernet0/3

ip address 10.0.0.3 255.255.255.0

!

!


!

ip forward-protocol nd

!

!

no ip http server

no ip http secure-server

ip route vrf Customer_A 172.30.30.0 255.255.255.0 172.18.7.252

!

!

control-plane

!

!

line con 0

logging synchronous

line aux 0

line vty 0 4

login

transport input none

!

!

End








====================================================

TEST-DC#sh ip route vrf Customer_B

 

Routing Table: Customer_B

Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

       E1 - OSPF external type 1, E2 - OSPF external type 2

       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

       ia - IS-IS inter area, * - candidate default, U - per-user static route

       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP

       a - application route

       + - replicated route, % - next hop override

 

Gateway of last resort is not set

 

      192.168.15.0/24 is variably subnetted, 2 subnets, 2 masks

C        192.168.15.0/24 is directly connected, Ethernet0/0.20

L        192.168.15.254/32 is directly connected, Ethernet0/0.20

      192.168.17.0/24 is variably subnetted, 2 subnets, 2 masks

C        192.168.17.0/24 is directly connected, Loopback3

L        192.168.17.254/32 is directly connected, Loopback3

TEST-DC#

TEST-DC#

TEST-DC#

TEST-DC#

TEST-DC#sh ip route vrf Customer_A

 

Routing Table: Customer_A

Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

       E1 - OSPF external type 1, E2 - OSPF external type 2

       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

       ia - IS-IS inter area, * - candidate default, U - per-user static route

       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP

       a - application route

       + - replicated route, % - next hop override

 

Gateway of last resort is not set

 

      172.18.0.0/16 is variably subnetted, 6 subnets, 2 masks

C        172.18.7.0/24 is directly connected, Loopback0

L        172.18.7.254/32 is directly connected, Loopback0

C        172.18.253.0/24 is directly connected, Loopback1

L        172.18.253.254/32 is directly connected, Loopback1

C        172.18.254.0/24 is directly connected, Ethernet0/0.10

L        172.18.254.254/32 is directly connected, Ethernet0/0.10

      172.30.0.0/24 is subnetted, 1 subnets

S        172.30.30.0 [1/0] via 172.18.7.252

TEST-DC#

 

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Sr.Net.Eng
Top Expert 2011
Commented:
You need to enable bgp for it to work. You don't need to create bgp neighbors, but you need to redistribute the loopbacks under the each vrf under bgp for example:

router bgp 123
no sync
no auto-summ
    
address-family ipv4 vrf Customer_A
redistribute connected ( or use network command instead that matches loopback subnet )
no auto-summ
no sync
exit-address-fam

address-family ipv4 vrf Customer_B
redistribute connected (or use network command instead that matches loopback subnet )
no auto-summ
no sync
exit-address-fam

Open in new window

Author

Commented:
Thanks, that makes better sense now

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial