Default Action
This
default-actionstatement overrides any action intrinsic to the protocol. This action is also nonterminating, so that various policy terms can be evaluated before the policy is terminated. You can specify a default action, eitheracceptorreject,as follows:[edit]policy-options {policy-statementpolicy-name{termterm-name{from {family family-name;match-conditions;policysubroutine-policy-name;prefix-listname;route-filterdestination-prefix match-type<actions>;source-address-filterdestination-prefix match-type<actions>;}to {match-conditions;policysubroutine-policy-name;}then {actions;default-action (accept | reject);}}}}The resulting action is set either by the protocol or by the last policy term that is met.
Example: Configure the Default Action for a Policy
Configure a routing policy that matches routes based on three policy terms. If the route matches the first term, a certain community tag is attached. If the route matches two separate terms, then both community tags are attached. If the route does not match any terms, it is rejected (protocol's default action). Note that the terms
hubandspokeare mutually exclusive.[edit]policy-options {policy-statementtest{termset-default{then default-action reject;}term hub {from interface ge-2/1/0.5;then {community add test-01-hub;default-action accept;}}term spoke {from interface [ ge-2/1/0.1 ge-2/1/0.2 ];then {community add test-01-spoke;default-action accept;}}term management {from protocol direct;then {community add management;default-action accept;}}}}