To configure a subroutine in a routing policy to be called from another routing policy, create the subroutine and specify its name using the policy match condition (described in Table 14) in the from or to statement of another routing policy:
- [edit]
-
policy-options {
-
-
policy-statement subroutine-policy-name {
-
- term term-name {
-
- from {
-
match-conditions;
- route-filter destination-prefix match-type <actions>;
- source-address-filter destination-prefix match-type <actions>;
- prefix-list name;
- }
-
- to {
-
match-conditions;
- }
- then actions;
- }
- }
- }
-
policy-options {
-
-
policy-statement policy-name {
-
- term term-name {
-
- from {
- policy subroutine-policy-name;
- }
-
- to {
- policy subroutine-policy-name;
- }
- then actions;
- }
- }
- }
![]() |
Note: Do not evaluate a routing policy within itself. If you attempt to do so, no prefixes will ever match the routing policy. |
The action specified in a subroutine is used to provide a match condition to the calling policy. If the subroutine specifies an action of accept, the calling policy considers the route to be a match. If the subroutine specifies an action of reject, the calling policy considers the route not to match. If the subroutine specifies an action that is meant to manipulate the route characteristics, the changes are made. For more details about the subroutine evaluation, see How a Routing Policy Subroutine Is Evaluated.