[Contents] [Prev] [Next] [Index] [Report an Error]

Applying Policy Expressions

Policy expressions give the policy framework software a different way to evaluate routing policies. A policy expression uses Boolean logical operators with policies. The logical operators establish rules by which the policies are evaluated.

During evaluation of a routing policy in a policy expression, the policy action of accept, reject, or next policy is converted to the value of TRUE or FALSE. This value is then evaluated against the specified logical operator to produce output of either TRUE or FALSE. The output is then converted back to a flow control action of accept, reject, or next policy. The result of the policy expression is applied as it would be applied to a single policy; the route is accepted or rejected and the evaluation ends, or the next policy is evaluated.

Table 17 summarizes the policy actions and their corresponding TRUE and FALSE values and flow control action values. Table 18 describes the logical operators. For complete information about policy expression evaluation, see How a Policy Expression Is Evaluated.

You must enclose a policy expression in parentheses. You can place a policy expression anywhere in the import or export statements and in the from policy statement.

Table 17: Policy Action Conversion Values

Policy Action

Conversion Value

Flow Control Action Conversion Value

Accept

TRUE

Accept

Reject

FALSE

Reject

Next policy

TRUE

Next policy

Table 18: Policy Expression Logical Operators

Logical Operator

Policy Expression Logic

How Logical Operator Affects Policy Expression Evaluation

&& (Logical AND)

Logical AND requires that all values must be TRUE to produce output of TRUE.

Routing policy value of TRUE and TRUE produces output of TRUE. Value of TRUE and FALSE produces output of FALSE. Value of FALSE and FALSE produces output of FALSE.

If the first routing policy returns the value of TRUE, the next policy is evaluated. If the first policy returns the value of FALSE, the evaluation of the expression ends and subsequent policies in the expression are not evaluated.

|| (Logical OR)

Logical OR requires that at least one value must be TRUE to produce output of TRUE.

Routing policy value of TRUE and FALSE produces output of TRUE. Value of TRUE and TRUE produces output of TRUE. Value of FALSE and FALSE produces output of FALSE.

If the first routing policy returns the value of TRUE, the evaluation of the expression ends and subsequent policies in the expression are not evaluated. If the first policy returns the value of FALSE, the next policy is evaluated.

! (Logical NOT)

Logical NOT reverses value of TRUE to FALSE and of FALSE to TRUE. It also reverses the actions of accept and next policy to reject, and reject to accept.

If used with the logical AND operator and the first routing policy value of FALSE is reversed to TRUE, the next policy is evaluated. If the value of TRUE is reversed to FALSE, the evaluation of the expression ends and subsequent policies in the expression are not evaluated.

If used with the logical OR operator and the first routing policy value of FALSE is reversed to TRUE, the evaluation of the expression ends and subsequent policies in the expression are not evaluated. If the value of TRUE is reversed to FALSE, the next policy is evaluated.

If used with a policy and the flow control action is accept or next policy, these actions are reversed to reject. If the flow control action is reject, this action is reversed to accept.

For more information, see the following sections:


[Contents] [Prev] [Next] [Index] [Report an Error]