Cisco Systems OL-14356-01 Network Router User Manual


 
Implementing Routing Policy on Cisco IOS XR Software
Information About Implementing Routing Policy on Cisco IOS XR Software
RC-381
Cisco IOS XR Routing Configuration Guide
OL-14356-01
endif
end-policy
router bgp 2
address-family ipv4 unicast
table-policy sample-table
.
.
.
Import
The import attach point provides control over the import of routes from the global VPN IPv4 table to a
particular VPN routing and forwarding (VRF) instance.
For Layer 3 VPN networks, provider edge (PE) routers learn of VPN IPv4 routes through the
Multiprotocol Internal Border Gateway Protocol (MP-iBGP) from other PE routers and automatically
filters out route announcements that do not contain route targets that match any import route targets of
its VRFs.
This automatic route filtering happens without RPL configuration; however, to provide more control
over the import of routes in a VRF, you can configure a VRF import policy.
The following example shows how to perform matches based on a route target extended community and
then sets the next hop. If the route has route target value 10:91, then the next hop is set to 206.0.0.1. If
the route has route target value 11:92, then the next hop is set to 206.0.0.2. If the route has Site-of-Origin
(SoO) value 10:111111 or 10:111222, then the route is dropped. All other non-matching routes are
dropped.
route-policy bgpvrf_import
if extcommunity rt matches-any (10:91) then
set next-hop 206.0.0.1
elseif extcommunity rt matches-every (11:92) then
set next-hop 206.0.0.2
elseif extcommunity soo matches-any (10:111111, 10:111222) then
pass
endif
end-policy
vrf vrf_import
address-family ipv4 unicast
import route-policy bgpvrf_import
.
.
.
Export
The export attach point provides control over the export of routes from a particular VRF to a global VPN
IPv4 table.
For Layer 3 VPN networks, export route targets are added to the VPN IPv4 routes when VRF IPv4 routes
are converted into VPN IPv4 routes and advertised through the MP-iBGP to other PE routers (or flow
from one VRF to another within a PE router).
A set of export route targets is configured with the VRF without RPL configuration; however, to set route
targets conditionally, you can configure a VRF export policy.
The following example shows some match and set operations supported for the export route policy. If a
route matches 206.92.1.0/24 then the route target extended community is set to 10:101, and the weight
is set to 211. If the route does not match 206.921.0/24 but the origin of the route is egp, then the local