Re: Import route from global table to VRF

From: Marko Milivojevic <markom_at_ipexpert.com>
Date: Sat, 13 Nov 2010 04:10:54 -0500

Naufal,

VRF import/export is done from and to BGP. Is your loopback present in
the BGP table for IPv4 unicast? If not, make sure it is and you will
see it imported to VRF. See below.

Initial configuration:

interface Loopback0
 ip address 1.1.1.1 255.255.255.255
!
ip prefix-list IMP-P seq 5 permit 1.1.1.1/32
!
route-map IMP permit 10
 match ip address prefix-list IMP-P
!
ip vrf TEST
 rd 10:10
 import ipv4 unicast map IMP
!

The result:

------------------------------8<------------------------------
R1#show ip route vrf TEST

Routing Table: TEST
Codes: 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

Gateway of last resort is not set

------------------------------8<------------------------------

Let's add BGP to the mix.

router bgp 1
 address-family ipv4
  redistribute connected
!

Now for the magic:

------------------------------8<------------------------------
R1#show ip bgp
BGP table version is 6, local router ID is 1.1.1.1
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
*> 1.1.1.1/32 0.0.0.0 0 32768 ?

R1#show ip route vrf TEST

Routing Table: TEST
Codes: 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

Gateway of last resort is not set

     1.0.0.0/32 is subnetted, 1 subnets
B 1.1.1.1 is directly connected, 00:01:02, Loopback0
------------------------------8<------------------------------

--
Marko Milivojevic - CCIE #18427
Senior Technical Instructor - IPexpert
FREE CCIE training: http://bit.ly/vLecture
Mailto: markom_at_ipexpert.com
Telephone: +1.810.326.1444
Web: http://www.ipexpert.com/
On Fri, Nov 12, 2010 at 21:28, Naufal Jamal <naufalccie_at_yahoo.in> wrote:
> I have two routers R1 and R2 connected over f0/0
>
> R1 has one vrf TEST which f0/0 is part of and R2 has no vrf.
>
> The eigrp is up between R1 and R2 on the vrf TEST
>
> R1 has a loopback interface, I want R2 to reach that loopback through the vrf
> TEST
> I advertised it in eigrp. I dont want loopback to be part of any VRF.
>
> Here is my config
> R1
>
> ip vrf TEST
> B rd 10:10
> B import ipv4 unicast map TEST
> B route-target import 10:101
>
> interface FastEthernet0/0
> B ip vrf forwarding TEST
> B ip address 1.1.1.2 255.255.255.0
> B duplex auto
> B speed auto
>
> interface Loopback1
> B ip address 3.3.3.3 255.255.255.0
>
> router eigrp 1965
> B no auto-summary
> B !
> B address-family ipv4 vrf TEST
> B redistribute connected
> B network 1.1.1.2 0.0.0.0
> B network 3.3.3.3 0.0.0.0
> B auto-summary
> B autonomous-system 1965
> B exit-address-family
>
> access-list 20 permit 3.3.3.0 0.0.0.255
>
> route-map TEST permit 10
> B match ip address 20
>
> show ip route
>
> R1(config-router-af)#do sh ip route
> Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
> B  B  B  D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
> B  B  B  N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
> B  B  B  E1 - OSPF external type 1, E2 - OSPF external type 2
> B  B  B  i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
> B  B  B  ia - IS-IS inter area, * - candidate default, U - per-user static
> route
> B  B  B  o - ODR, P - periodic downloaded static route
>
> Gateway of last resort is not set
>
> B  B  3.0.0.0/24 is subnetted, 1 subnets
> C B  B  B  3.3.3.0 is directly connected, Loopback1
>
> R1(config-router-af)#do sh ip route vrf TEST
>
> Routing Table: TEST
> Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
> B  B  B  D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
> B  B  B  N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
> B  B  B  E1 - OSPF external type 1, E2 - OSPF external type 2
> B  B  B  i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
> B  B  B  ia - IS-IS inter area, * - candidate default, U - per-user static
> route
> B  B  B  o - ODR, P - periodic downloaded static route
>
> Gateway of last resort is not set
>
> B  B  1.0.0.0/24 is subnetted, 1 subnets
> C B  B  B  1.1.1.0 is directly connected, FastEthernet0/0
> ===============================================
>
> R2 Config
>
> interface FastEthernet0/0
> B ip address 1.1.1.1 255.255.255.0
> B duplex auto
> B speed auto
>
> B router eigrp 1965
> B network 1.1.1.1 0.0.0.0
> B no auto-summary
>
>
> R2#sh ip route
> Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
> B  B  B  D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
> B  B  B  N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
> B  B  B  E1 - OSPF external type 1, E2 - OSPF external type 2
> B  B  B  i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
> B  B  B  ia - IS-IS inter area, * - candidate default, U - per-user static
> route
> B  B  B  o - ODR, P - periodic downloaded static route
>
> Gateway of last resort is not set
>
> B  B  1.0.0.0/24 is subnetted, 1 subnets
> C B  B  B  1.1.1.0 is directly connected, FastEthernet0/0
>
>
> Can anyone assist me in this config, I want to import a connected route from
> global to vrf of R1's routing table table
Blogs and organic groups at http://www.ccie.net
Received on Sat Nov 13 2010 - 04:10:54 ART

This archive was generated by hypermail 2.2.0 : Sun Dec 05 2010 - 22:14:56 ART