Thursday, July 23, 2015

VRF Route Leaking from Global Routing Table

This exercise was first post by Arwin Reprakash (http://ithitman.blogspot.com/2013/10/vrf-route-leaking-from-global-routing.html#more). I took his post and found another way to resolve the problem but using policy based routing


The diagrams and original idea belongs to Arwin Reprakash


How to leak routes between Global and vrf routing table using policy based routing


 


The fnal result will be to reach route 10.10.10.1 from R3 and reach route 3.3.3.3 from R1.  The particular thing about this is to switch between global routing table and vrf RED table





These steps are for R2:


1) Set the policy based routing for the interface inside OSPF área 0

                                 ip policy route-map FROMVRF2GLOBAL


2)Set the policy based routing for the interface inside BGP área


                                ip policy route-map FROMGLOBAL2VRF


3) Set the route map "FROMVRF2GLOBAL" in the global configuration mode


                       route-map FROMVRF2GLOBAL permit 10
                               match ip address prefix-list GLOBALROUTES
                               set global


What this means is ...If the destiny route match the global route  10.10.10.0 defined in the prefix-list GLOBALROUTES ... then....it should be handle by the global routing table


4) Set the route map "FROMGLOBAL2VRF" in the global configuration mode


                         route-map FROMGLOBAL2VRF permit 10
                                     match ip address prefix-list VRFROUTES
                                     set vrf RED


What this means is ...If the destiny route match the vrf RED route 3.3.3.0 defined in the prefix-list GLOBALROUTES ... then....it should be handle by the vrf RED routing table


5) Set the prefix list  GLOBALROUTES with the routes from the global table


                             ip prefix-list GLOBALROUTES seq 20 permit 10.10.10.0/24


6) Set the prefix list  VRFROUTES with the routes from the vrf RED table


                            ip prefix-list VRFROUTES seq 20 permit 3.3.3.0/24



Finally set R2 as a default Gateway for:

R1:    ip route 0.0.0.0 0.0.0.0 1.1.1.2
R3:    ip route 0.0.0.0 0.0.0.0 192.168.1.2


Now you should ping 10.10.10.1 from R3 and ping 3.3.3.3 from R1




I use cisco virl for these labs but i think they will work ok in GNS3 too.

Please leave your feedback

No comments:

Post a Comment