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

test policy

Syntax

test policy policy-name prefix

Release Information

Command introduced before JUNOS Release 7.4.

Description

Test a policy configuration to determine which prefixes match routes in the routing table.

Options

policy-nameName of a policy.

prefixDestination prefix to match.

Additional Information

All prefixes in the default unicast routing table (inet.0) that match prefixes that are the same as or longer than the specific prefix are processed by the from clause in the specified policy. All prefixes accepted by the policy are displayed. The test policy command evaluates a policy differently from the Border Gateway Protocol (BGP) import process. When testing a policy that contains an interface match condition in the from clause, the test policy command uses the match condition. In contrast, BGP does not use the interface match condition when evaluating the policy against routes learned from internal BGP (IBGP) or external BGP (EGBP) multihop peers.

Required Privilege Level

view

Related Topics

show policy damping

List of Sample Output

test policy

Output Fields

For information about output fields, see the show route command (Table 93), the show route detail command (Table 96), the show route extensive command (Table 102), or the show route terse command (Table 110). The last line of output is unique to the test policy command. It provides the policy name and number of prefixes accepted and rejected.

Sample Output

test policy

user@host> test policy test-statics 3.0.0.1/8
inet.0: 44 destinations, 44 routes (44 active, 0 holddown, 0 hidden)
Prefixes passing policy:

3.0.0.0/8          *[BGP/170] 16:22:46, localpref 100, from 10.255.255.41
                   AS Path: 50888 I
                    > to 10.11.4.32 via en0.2, label-switched-path l2
3.3.3.1/32         *[IS-IS/18] 2d 00:21:46, metric 0, tag 2
                    > to 10.0.4.7 via fxp0.0
3.3.3.2/32         *[IS-IS/18] 2d 00:21:46, metric 0, tag 2
                    > to 10.0.4.7 via fxp0.0
3.3.3.3/32         *[IS-IS/18] 2d 00:21:46, metric 0, tag 2
                    > to 10.0.4.7 via fxp0.0
3.3.3.4/32         *[IS-IS/18] 2d 00:21:46, metric 0, tag 2
                    > to 10.0.4.7 via fxp0.0
Policy test-statics: 5 prefixes accepted, 0 prefixes rejected

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