show policy

Syntax

show policy [interface <ID> [in]] [<POLICY-NAME>] [commands] [configuration]

show policy [hitcounts <POLICY-NAME> [interface <ID> [in]]] [vsx-peer]

Description

Shows various aspects of policies and their current use.

Use the show policy hitcounts command to display policy statistics.

Command context

Operator (>) or Manager (#)

Parameters

All parameters are optional.

interface <ID>

Specifies limiting the display to a specific interface.

in

Specifies limiting the display to ingress policies

<POLICY-NAME>

Specifies displaying information matching this policy name.

[commands]

Specifies display output as CLI commands showing the configured policy entries.

[configuration]

Specifies display policies that have been configured, including those policies not active because of issues with the command parameters or hardware issues. This parameter is useful if there is a mismatch between the entered configuration and the previous successfully programmed (active) policies.

hitcounts

Specifies display policy hit counts (statistics). The switch displays the number of accepted bytes/conformed bytes (green and yellow bytes) as 0 kbps because of the type of switch chipset.

[vsx-peer]

Shows the output from the VSX peer switch. If the switches do not have the VSX configuration or the ISL is down, the output from the VSX peer switch is not displayed.

Authority

Operators or Administrators. Users without administrator authority can execute this command from the operator context (>) only.

Examples

Showing information for all policies:

switch# show policy
           Name
  Sequence Comment
           Class Type
                    action
-------------------------------------------------------------------------------
           MY_POLICY
        10 This is my QOS policy.
           class1 ip
                    dscp af21
                    drop
        20 This is my PBR policy.
-------------------------------------------------------------------------------

Showing policy CLI commands:

switch# show policies commands
policy MY_POLICY
       10 class ip MY_CLASS1 action dscp af21 action drop
       20 comment pbr policy string

Showing policy statistics for hit counts:

switch# show policy hitcounts policyA interface 1/1/2
Statistics for Policy policyA:
Interface 1/1/2* (in):
           Hit Count  Configuration
10 class ip test action cir kbps 1 cbs 1 exceed drop 
                   0  10 match any any any count [0 kbps conform]
                   0  20 match any any any count [0 kbps conform]
* policy statistics are shared among all applied interfaces
  use 'policy NAME copy' to create a uniquely named policy

The switch displays the number of accepted bytes/conformed bytes (green and yellow bytes) as 0 kbps because of the type of switch chipset. The configuration from the example was created as follows:

switch(config)# class ip test
switch(config-class-ip)# 10 match any any any count
switch(config-class-ip)# 20 match any any any count
switch(config-class-ip)# exit
switch(config)# policy policyA
switch(config-policy)# 10 class ip test action cir kbps 1 cbs 1 exceed drop 
switch(config)# interface 1/1/2 
switch(config-if)# no shutdown
switch(config-if)# apply policy policyA in