Route leaking or route replication is typically used in scenarios requiring the use of shared services. Configuring route
replication allows mutual redistribution of routes between VPNs. Route leaking allows sharing services because routes are
replicated between VPNs and clients who reside in one VPN can reach matching prefixes that exist in another VPN.
Topology Example
In this section, we'll take an example topology to show route-leaking configuration. Here, Edge routers 1 and 2 are located
in two different sites in the overlay network and are connected to each other through MPLS network. Both the edge routers
have route leaking configured to be able to access services in the underlay network. Router 1 sits behind Edge Router 1 in
the service side. The local network at this site runs OSPF. Router 2 sites behind the Edge Router 2 on network that has eBGP
in VPN 1. Router 3 also sites behind Edge Router 2 and has OSPF running in VPN 200.
Edge Router 1 imports the source IP address of Router 1, 192.0.2.0/24 to VPN 0 on Edge Router 1. Thus 192.0.2.0/24 is a route
leaked into VPN 0. Edge Router 2 imports the source IP address of Router 2, 198.51.100.0/24 and the source IP address of Edge
Router 3,203.0.113.0/24 to VPN 0 on Edge Router 2.
Shared services in the underlay MPLS network are accessed through a loopback address of 209.21.25.18/27. The IP address of
the shared services are advertised to VPN 0 on Edge Routers 1 and 2 through BGP. This shared service IP address is then leaked
to VPN 1 in Edge Router 1 and VPN 1 and VPN 200 in Edge Router 2. In terms of route-leaking, the leaked routes are imported
into the service VPNs on both the edge routers.
Note |
By default, OMP doesn't advertise any leaked routes from service VPNs into the overlay network to prevent route looping.
|
Configure Route Leaking
The following example shows route import and export on Edge Router 1.
Edge Router 1(config)# vpn 1
Edge Router 1(vpn-1)# route-export ospf
Edge Router 1(vpn-1)# route-import ospf
The following example shows import and export of BGP and OSPF routes on Edge Router 2.
Edge Router 2(config)# vpn 1
Edge Router 1(vpn-1)# route-export bgp
Edge Router 1(vpn-1)# route-import ospf
Edge Router 2(config)# vpn 200
Edge Router 1(vpn-200)# route-export bgp
Edge Router 1(vpn-1)# route-import ospf
Route Redistribution
OSPF learns routes from other VPNs leaking routes into OSPF. The same is true of BGP. In this example, we'll look at how to
have OSPF and BGP redistribute the routes learned from route leaking. The following examples show OSPF redistributing connected,
static, and OMP routes; and BGP redistributing OMP and static routes.
Edge Router 1# show running-config vpn 1 router
vpn 1
router
ospf
redistribute static
redistribute connected
redistribute omp
area 0
interface ge0/4
hello-interval 1
dead-interval 3
exit
exit
!
!
!
Edge Router 2# show running-config vpn 1 router
vpn 1
router
bgp 1
timers
keepalive 1
holdtime 3
!
address-family ipv4-unicast
redistribute static
redistribute omp
!
neighbor 198.51.100.1
no shutdown
remote-as 2
timers
connect-retry 2
advertisement-interval 1
!
!
!
!
!
Verify Route Leaking Configuration
Use the show ip routes command to view the IP addresses that are leaked along with their status. The following output shows the routes leaked into
VPN 1 and VPN 200 on Edge Router 2.
Note |
In the outputs, the imported routes are represented by L in the status column.
|
Routes Leaked from VPNs 1 and 200 on Edge Router 2
Device# show ip routes 209.165.201.0/27
Codes Proto-sub-type:
IA -> ospf-intra-area, IE -> ospf-inter-area,
E1 -> ospf-external1, E2 -> ospf-external2,
N1 -> ospf-nssa-external1, N2 -> ospf-nssa-external2,
e -> bgp-external, i -> bgp-internal
Codes Status flags:
F -> fib, S -> selected, I -> inactive,
B -> blackhole, R -> recursive, L -> import
PROTOCOL NEXTHOP NEXTHOP NEXTHOP
VPN PREFIX PROTOCOL SUB TYPE IF NAME ADDR VPN TLOC IP COLOR ENCAP STATUS
---------------------------------------------------------------------------------------------------------------------------------------------
0 209.165.201.0/27 ospf IA ge0/0 10.1.16.13 - - - - F,S
0 209.165.201.0/27 ospf IA ge0/3 10.0.21.23 - - - - F,S
1 209.165.201.0/27 static - - - 0 - - - F,S,L
200 209.165.201.0/27 static - - - 0 - - - F,S,L
BGP Routes Leaked to VPN 0 on Edge Router 2
Device# show ip routes 198.51.100.0/24
Codes Proto-sub-type:
IA -> ospf-intra-area, IE -> ospf-inter-area,
E1 -> ospf-external1, E2 -> ospf-external2,
N1 -> ospf-nssa-external1, N2 -> ospf-nssa-external2,
e -> bgp-external, i -> bgp-internal
Codes Status flags:
F -> fib, S -> selected, I -> inactive,
B -> blackhole, R -> recursive, L -> import
PROTOCOL NEXTHOP NEXTHOP NEXTHOP
VPN PREFIX PROTOCOL SUB TYPE IF NAME ADDR VPN TLOC IP COLOR ENCAP STATUS
---------------------------------------------------------------------------------------------------------------------------------------------
0 198.51.100.0/24 static - - - 1 - - - F,S,L
1 198.51.100.0/24 bgp e ge0/4 10.0.21.22 - - - - F,S
See VPN Next Hop Information
Run the show ip fib command to view the next hop information for VPNs.
Example of next hop information for VPN 1
Device# show ip fib vpn 1
NEXTHOP NEXTHOP NEXTHOP NEXTHOP SA
VPN PREFIX IF NAME ADDR LABEL VPN INDEX TLOC IP COLOR
---------------------------------------------------------------------------------------------------------------------------------------
1 10.0.5.0/24 - - - 0 - - -
1 10.0.6.0/24 - - - 0 - - -
1 10.0.101.3/32 - - - 0 - - -
1 10.0.101.4/32 - - - 0 - - -
1 10.0.111.1/32 - - - 0 - - -
1 209.165.201.0/27 - - - 0 - - -
Example of next hop information for VPN 0
Device# show ip fib vpn 0
NEXTHOP NEXTHOP NEXTHOP NEXTHOP SA
VPN PREFIX IF NAME ADDR LABEL VPN INDEX TLOC IP COLOR
---------------------------------------------------------------------------------------------------------------------------------------
0 198.51.100.0/24 - - - 1 - - -
View Packets and Transmission Statistics
To view the packets received and the transmission statistics for an interface, use the show app cflows flows command.
Device# show app cflowd flows
TCP TIME EGRESS INGRESS
SRC DEST IP CNTRL ICMP TOTAL TOTAL MIN MAX TO INTF INTF APP
VPN SRC IP DEST IP PORT PORT DSCP PROTO BITS OPCODE NHOP IP PKTS BYTES LEN LEN START TIME EXPIRE NAME NAME ID
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 10.0.5.11 172.16.255.118 0 0 0 1 0 2048 198.51.100.0 152 14896 98 98 Tue May 26 15:33:13 2020 59 ge0/4 ge0/0 0
1 10.0.26.11 172.16.255.118 0 0 0 1 0 2048 198.51.100.0 76 7448 98 98 Tue May 26 15:33:15 2020 58 ge0/4 ge0/3 0
1 172.16.255.118 10.0.5.11 0 0 0 1 0 0 10.0.21.23 152 14896 98 98 Tue May 26 15:33:13 2020 59 ge0/3 ge0/4 0
1 172.16.255.118 10.0.26.11 0 0 0 1 0 0 10.0.21.23 76 7448 98 98 Tue May 26 15:33:15 2020 58 ge0/3 ge0/4 0