
neighbor 10.0.0.1
remote-as 3
address-family ipv4 unicast
route-policy sample_import in
.
.
.
Network
The network attach point controls the injection of routes from the RIB into BGP. A route policy attached at
this point is able to set any of the valid BGP attributes on the routes that are being injected.
The following example shows a route policy attached at the network attach point that sets the well-known
community no-export for any routes more specific than /24:
route-policy NetworkControl
if destination in (0.0.0.0/0 ge 25) then
set community (no-export) additive
endif
end-policy
router bgp 2
address-family ipv4 unicast
network 172.16.0.5/27 route-policy NetworkControl
Redistribute
The redistribute attach point within OSPF injects routes from other routing protocol sources into the OSPF
link-state database, which is done by selecting the routes it wants to import from each protocol. It then sets
the OSPF parameters of cost and metric type. The policy can control how the routes are injected into OSPF
by using the
set metric-type
or
set ospf-metric
command.
The following example shows how to redistribute routes from IS-IS instance instance_10 into OSPF instance
1 using the policy OSPF-redist. The policy sets the metric type to type-2 for all redistributed routes. IS-IS
routes with a tag of 10 have their cost set to 100, and IS-IS routes with a tag of 20 have their OSPF cost set
to 200. Any IS-IS routes not carrying a tag of either 10 or 20 are not be redistributed into the OSPF link-state
database.
route-policy OSPF-redist
set metric-type type-2
if tag eq 10 then
set ospf cost 100
elseif tag eq 20 then
set ospf cost 200
else
drop
endif
end-policy
router ospf 1
redistribute isis instance_10 policy OSPF-redist
.
.
.
Routing Configuration Guide for Cisco NCS 6000 Series Routers, IOS XR Release 6.4.x
410
Implementing Routing Policy
Network