Hands-On Lab: Configuring Route Leaking Between VRFs

This hands-on lab configures selective route leaking between two VRFs using route targets and a shared services VRF, allowing specific routes to cross the otherwise strict isolation boundary established in the previous VRF-Lite lab.

VRF Route LeakingRoute Target Import ExportShared Services VRF

~4 دقیقه مطالعه · آخرین به‌روزرسانی ۲ مهر ۱۴۰۵

Lab Objective

Configure route targets on two customer VRFs and a shared services VRF, selectively leak a shared server's route into both customer VRFs, and verify each customer can reach the shared service while remaining isolated from each other.

Lab Purpose

The strict isolation demonstrated in the previous VRF-Lite lab is often too rigid for real deployments — many multi-tenant designs need customers isolated from each other while still sharing access to common resources like a shared DNS server or internet gateway. Route leaking using route targets provides controlled, selective exceptions to VRF isolation.

Lab Topology

R1
  VRF CUSTOMER-A: Gi0/0, 10.1.1.1/24
  VRF CUSTOMER-B: Gi0/1, 10.2.2.1/24
  VRF SHARED: Gi0/2, 10.99.99.1/24
              (shared DNS server here)

Goal: both CUSTOMER-A and CUSTOMER-B should
reach 10.99.99.0/24, but CUSTOMER-A and
CUSTOMER-B should still not reach each other

Task 1: Configure Three VRFs with Route Distinguishers and Targets

Configure CUSTOMER-A, CUSTOMER-B, and SHARED VRFs, each with a unique route distinguisher and appropriate route targets for leaking.

Task 2: Configure Each VRF to Export Its Own Routes

Configure each customer VRF to export its routes with a unique route target, and SHARED to export its routes with its own route target.

Task 3: Configure Each Customer VRF to Import SHARED's Routes

Configure both CUSTOMER-A and CUSTOMER-B to import SHARED's route target.

Task 4: Configure SHARED to Import Both Customer Route Targets

Configure SHARED to import both customer VRFs' route targets, allowing return traffic to reach them.

Task 5: Verify Selective Connectivity

Confirm both customers can reach the shared server, while still being unable to reach each other.

Solution and Verification

R1(config)# vrf definition CUSTOMER-A
R1(config-vrf)# rd 65001:1
R1(config-vrf)# address-family ipv4
R1(config-vrf-af)# route-target export 65001:1
R1(config-vrf-af)# route-target import 65001:99
R1(config-vrf-af)# exit-address-family

R1(config)# vrf definition CUSTOMER-B
R1(config-vrf)# rd 65001:2
R1(config-vrf)# address-family ipv4
R1(config-vrf-af)# route-target export 65001:2
R1(config-vrf-af)# route-target import 65001:99
R1(config-vrf-af)# exit-address-family

R1(config)# vrf definition SHARED
R1(config-vrf)# rd 65001:99
R1(config-vrf)# address-family ipv4
R1(config-vrf-af)# route-target export 65001:99
R1(config-vrf-af)# route-target import 65001:1
R1(config-vrf-af)# route-target import 65001:2

-- SHARED imports both customer route
-- targets, enabling it to route traffic
-- BACK to either customer, while each
-- customer only imports SHARED's route
-- target, never each other's

R1(config)# interface gigabitethernet0/0
R1(config-if)# vrf forwarding CUSTOMER-A
R1(config-if)# ip address 10.1.1.1 255.255.255.0
R1(config-if)# no shutdown
R1(config)# interface gigabitethernet0/1
R1(config-if)# vrf forwarding CUSTOMER-B
R1(config-if)# ip address 10.2.2.1 255.255.255.0
R1(config-if)# no shutdown
R1(config)# interface gigabitethernet0/2
R1(config-if)# vrf forwarding SHARED
R1(config-if)# ip address 10.99.99.1 255.255.255.0
R1(config-if)# no shutdown

R1# show ip route vrf CUSTOMER-A

Routing Table: CUSTOMER-A
C    10.1.1.0/24 is directly connected, GigabitEthernet0/0
B    10.99.99.0/24 [200/0] via ... (leaked from SHARED)

R1# show ip route vrf CUSTOMER-B

Routing Table: CUSTOMER-B
C    10.2.2.0/24 is directly connected, GigabitEthernet0/1
B    10.99.99.0/24 [200/0] via ... (leaked from SHARED)
-- Both customer VRFs now show the shared
-- subnet as a leaked route

R1# show ip route vrf CUSTOMER-A | include 10.2.2.0
-- (no output -- CUSTOMER-B's network never
--  appears, since neither customer imports
--  the other's route target)

CustomerA-Host> ping 10.99.99.10 (shared DNS)
!!!!!
Success rate is 100 percent (5/5)

CustomerB-Host> ping 10.99.99.10 (shared DNS)
!!!!!
Success rate is 100 percent (5/5)

CustomerA-Host> ping 10.2.2.10 (CustomerB's host)
.....
Success rate is 0 percent (0/5)
-- Exactly the intended result: shared
-- resource reachable by both, customers
-- still isolated from each other

Key Takeaway

Route leaking with route targets works through a simple, asymmetric import/export pattern: a VRF exports its routes tagged with its own identifier, and any VRF wanting to receive those routes must explicitly import that same tag — CUSTOMER-A and CUSTOMER-B never import each other's tags, so isolation between them remains completely intact even while both selectively import SHARED's routes, demonstrating that route leaking is precise and additive rather than an all-or-nothing relaxation of VRF isolation.

نوشته و پژوهش‌شده توسط دکتر شاهین صیامی

مقالات مرتبط

Hands-On Lab: Final Comprehensive CCNP Troubleshooting Challenge (BGP, DMVPN, and QoS Integration)

This hands-on lab presents a complex multi-layer failure across an integrated BGP-over-DMVPN topology combined with QoS marking, requiring systematic diagnosis of a route reflector misconfiguration, an NHRP registration failure, and an incorrectly applied QoS policy simultaneously affecting the same network.

ادامه

Hands-On Lab: Configuring BGP over DMVPN

This hands-on lab runs iBGP as the routing protocol across the same DMVPN hub-and-spoke topology used in the two previous labs, configuring the hub as a route reflector so spokes learn each other's routes without a full iBGP mesh, combining two previously separate concepts into one integrated design.

ادامه

Hands-On Lab: Configuring OSPF over DMVPN

This hands-on lab runs OSPF as the dynamic routing protocol across the same DMVPN hub-and-spoke topology, configuring the tunnel interface as an OSPF point-to-multipoint network type to correctly handle the hub-and-spoke adjacency pattern without requiring the broadcast network type's DR/BDR election.

ادامه

Hands-On Lab: Configuring EIGRP over DMVPN

This hands-on lab runs EIGRP as the dynamic routing protocol across the DMVPN hub-and-spoke topology built in earlier labs, verifying neighbor relationships form correctly across the multipoint tunnel and routes propagate without requiring per-spoke static configuration on the hub.

ادامه

Hands-On Lab: Configuring HSRP MD5 Authentication

This hands-on lab configures MD5 authentication on an HSRP group, verifying two routers with matching authentication strings form a normal active/standby relationship while a router with a mismatched string is excluded from the group entirely.

ادامه

Hands-On Lab: Configuring Cisco Umbrella-Style DNS Security via DNS Forwarding Redirection

This hands-on lab configures a router to redirect all client DNS queries toward a security-focused DNS resolver using DNS forwarding interception, approximating cloud-delivered DNS security enforcement without requiring per-client configuration changes.

ادامه