Modular Inbound Policy: Example - Cisco NCS 6000 Series Configuration Manual

Ios xr release 6.4.x
Hide thumbs Also See for NCS 6000 Series:
Table of Contents

Advertisement

Modular Inbound Policy: Example

10.0.0.0/8 le 32,
172.16.0.0/12 le 32,
192.168.0.0/16 le 32
end-set
route-policy inbound-tx
if destination in too-specific or destination in rfc1918 then
drop
endif
set med 1000
set local-preference 90
set community (2:1001) additive
if community matches-any ([101..106]:202) then
prepend as-path 2.30 2
set community (2:666) additive
if med is 666 or med is 225 then
set origin incomplete
else
set origin igp
endif
else
set community (2:999) additive
endif
end-policy
router bgp 2
neighbor 10.0.1.2 address-family ipv4 unicast route-policy inbound-tx in
Modular Inbound Policy: Example
The following policy example shows how to build two inbound policies, in-100 and in-101, for two different
peers. In building the specific policies for those peers, the policy reuses some common blocks of policy that
may be common to multiple peers. It builds a few basic building blocks, the policies common-inbound,
filter-bogons, and set-lpref-prepend.
The filter-bogons building block is a simple policy that filters all undesirable routes, such as those from the
RFC 1918 address space. The policy set-lpref-prepend is a utility policy that can set the local preference and
prepend the AS path according to parameterized values that are passed in. The common-inbound policy uses
these filter-bogons building blocks to build a common block of inbound policy. The common-inbound policy
is used as a building block in the construction of in-100 and in-101 along with the set-lpref-prepend building
block.
This is a simple example that illustrates the modular capabilities of the policy language.
prefix-set bogon
end-set
!
route-policy in-100
Routing Configuration Guide for Cisco NCS 6000 Series Routers, IOS XR Release 6.4.x
458
10.0.0.0/8 ge 8 le 32,
0.0.0.0,
0.0.0.0/0 ge 27 le 32,
192.168.0.0/16 ge 16 le 32
apply common-inbound
if community matches-any ([100..120]:135) then
apply set-lpref-prepend (100,100,2)
set community (2:1234) additive
else
set local-preference 110
endif
if community matches-any ([100..666]:[100..999]) then
Implementing Routing Policy

Advertisement

Table of Contents
loading

Table of Contents