Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
Junos CLI Reference
Table of Contents Expand all
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

show policy

date_range 19-Nov-23

Syntax

content_copy zoom_out_map
show policy
<logical-system (all | logical-system-name)>
<policy-name>
<statistics >

Syntax (EX Series Switches)

content_copy zoom_out_map
show policy
<policy-name>

Description

Display information about configured routing policies.

Options

none

List the names of all configured routing policies.

logical-system (all | logical-system-name)

(Optional) Perform this operation on all logical systems or on a particular logical system.

policy-name

(Optional) Show the contents of the specified policy.

statistics

(Optional) Use in conjunction with the test policy command to show the length of time (in microseconds) required to evaluate a given policy and the number of times it has been executed. This information can be used, for example, to help structure a policy so it is evaluated efficiently. Timers shown are per route; times are not cumulative. Statistics are incremented even when the router is learning (and thus evaluating) routes from peering routers.

Required Privilege Level

view

Output Fields

Table 1 lists the output fields for the show policy command. Output fields are listed in the approximate order in which they appear.

Table 1: show policy Output Fields

Field Name

Field Description

policy-name

Name of the policy listed.

term

Name of the user-defined policy term. The term name unnamed is used for policy elements that occur outside of user defined terms

from

Match condition for the policy.

then

Action for the policy.

Sample Output

show policy

content_copy zoom_out_map
user@host> show policy
Configured policies:
__vrf-export-red-internal__
__vrf-import-red-internal__
red-export
rf-test-policy
multicast-scoping

show policy policy-name

content_copy zoom_out_map
user@host> show policy vrf-import-red-internal
Policy vrf-import-red-internal:
    from
         203.0.113.0/28  accept
         203.0.113.32/28  accept
    then reject

show policy statistics policy-name

content_copy zoom_out_map
user@host> show policy statistics iBGP-v4-RR-Import
Policy iBGP-v4-RR-Import:
    [1243328] Term Lab-Infra:
        from [1243328 0]  proto BGP
             [28 0] route filter:
                 10.11.0.0/8 orlonger
                 10.13.0.0/8 orlonger
        then [28 0] accept
    [1243300] Term External:
        from [1243300 1]  proto BGP
         [1243296 0]  community Ext-Com1 [64496:1515 ]
         [1243296 0]  prefix-list-filter Customer-Routes
         [1243296 0]  aspath AS6221
             [1243296 1] route filter:
                 172.16.49.0/12 orlonger
                 172.16.50.0/12 orlonger
                 172.16.51.0/12 orlonger
                 172.16.52.0/12 orlonger
                 172.16.56.0/12 orlonger
                 172.16.60.0/12 orlonger
        then [1243296 2] community + Ext-Com2 [64496:2000 ] [1243296 0] accept
    [4] Term Final:
        then [4 0] reject

Release Information

Command introduced before Junos OS Release 7.4.

statistics option introduced in Junos OS Release 16.1 for MX Series routers.

footer-navigation