Exam 642-883 | Question id=3461 | Route Manipulations in Service Provider Environments |
When using the Cisco IOS XR route policy language to define a logical if-then-else condition, which logical operator has the highest precedence?
A. |
AND | |
B. |
OR | |
C. |
NOT | |
D. |
IS | |
E. |
IN |
Boolean expressions are evaluated in order of operator precedence, from left to right.
The highest precedence operator is not, followed by and and then or. The following expression:
med eq 10 and not destination in (10.1.3.0/24) or community matches-any ([10..25]:35)
if fully parenthesized to display the order of evaluation would look like this:
(med eq 10 and (not destination in (10.1.3.0/24))) or community matches-any <[10..25]:35)
The inner not applies only to the destination test; the and combines the result of the not expression with the Multi Exit Discriminator (MED) test: and the or combines that result with the community test If the order of operations are rearranged:
not med eq 10 and destination in (10.1.3.0/24) or community matches-any ([10..25]:35)
then the expression, fully parenthesized, would look like the following:
((not med eq 10) and destination in (10.1.3.0/24)) or community matches-any ([10..25]:35)