In addition to the well-established use of match conditions in the from statement of a policy, you can also configure the condition statement to define conditions that will be used in the policy evaluation:
-
condition condition-name {
- if-route-exists address table table-name;
- }
You can include this statement at the following hierarchy levels:
To define a policy condition based on the existence of routes in specific tables for use in BGP export policies, specify a name for the condition and include the following options:
You can then add the defined condition to the from statement of a policy:
- policy-options {
-
- policy-statement policy-name {
-
- term 1 {
-
- from {
- protocols bgp;
- condition condition-name;
- }
-
- then {
- accept;
- }
- }
-
- ...
- }
The condition statement is available on all platforms, but is limited to use in BGP export policies. To view the configured policy conditions and their associated routing tables and dependent routes, issue the show policy conditions operational mode command; for more information, see the JUNOS Routing Protocols and Policies Command Reference.