Boolean Conditions - Cisco ASR 9000 Series Configuration Manual

Aggregation services router
Hide thumbs Also See for ASR 9000 Series:
Table of Contents

Advertisement

Implementing Routing Policy
drop
endif
The example indicates that any routes whose AS path is in the set as-path-set-1 are dropped. The contents of
the then clause may be an arbitrary sequence of policy statements.
The following example contains two action statements:
if origin is igp then
set med 42
prepend as-path 73.5 5
endif
The CLI provides support for the exit command as an alternative to the endif command.
The if statement also permits an else clause, which is executed if the if condition is false:
if med eq 8 then
set community (12:34) additive
else
set community (12:56) additive
endif
The policy language also provides syntax, using the elseif keyword, to string together a sequence of tests:
if med eq 150 then
set local-preference 10
elseif med eq 200 then
set local-preference 60
elseif med eq 250 then
set local-preference 110
else
set local-preference 0
endif
The statements within an if statement may themselves be if statements, as shown in the following example:
if community matches-any (12:34,56:78) then
if med eq 150 then
drop
endif
set local-preference 100
endif
This policy example sets the value of the local preference attribute to 100 on any route that has a community
value of 12:34 or 56:78 associated with it. However, if any of these routes has a MED value of 150, then these
routes with either the community value of 12:34 or 56:78 and a MED of 150 are dropped.

Boolean Conditions

In the previous section describing the if statement, all of the examples use simple Boolean conditions that
evaluate to either true or false. RPL also provides a way to build compound conditions from simple conditions
by means of Boolean operators.
Three Boolean operators exist: negation (not), conjunction (and), and disjunction (or). In the policy language,
negation has the highest precedence, followed by conjunction, and then by disjunction. Parentheses may be
used to group compound conditions to override precedence or to improve readability.
OL-30423-03
Cisco ASR 9000 Series Aggregation Services Router Routing Configuration Guide, Release 5.1.x
Policy Statements
489

Advertisement

Table of Contents
loading

Table of Contents