Skip to content

Policy

Policy configuration provides comprehensive traffic classification and action enforcement through class-maps and policy-maps that define how network traffic should be identified, prioritized, and processed based on various criteria including DSCP markings, protocols, and authentication states. It supports both Quality of Service (QoS) policies for bandwidth management, prioritization, and queuing, as well as control policies for network access control that define actions to take based on authentication events and user authorization status. Policy framework enables fine-grained traffic engineering, security enforcement, and service differentiation by combining flexible matching criteria with configurable actions such as rate limiting, priority queuing, and service template activation.

Diagram
NameTypeConstraintMandatoryDefault Value
policyClass[policy]No

NameTypeConstraintMandatoryDefault Value
class_mapsList[class_maps]No
policy_mapsList[policy_maps]No

class_maps (iosxe.devices.configuration.policy)

Section titled “class_maps (iosxe.devices.configuration.policy)”
NameTypeConstraintMandatoryDefault Value
nameStringYes
typeChoicecontrol, subscriberNo
subscriberBooleantrue, falseNo
prematchChoicematch-all, match-any, match-noneNo
matchClass[match]No
descriptionStringNo

policy_maps (iosxe.devices.configuration.policy)

Section titled “policy_maps (iosxe.devices.configuration.policy)”
NameTypeConstraintMandatoryDefault Value
nameStringYes
typeChoiceaccess-control, appnav, control, epbr, inspect, packet-service, performance-monitor, queueing, service, service-chain, umbrellaNo
subscriberBooleantrue, falseNo
descriptionStringNo
classesList[classes]No
eventsList[events]No

match (iosxe.devices.configuration.policy.class_maps)

Section titled “match (iosxe.devices.configuration.policy.class_maps)”
NameTypeConstraintMandatoryDefault Value
authorization_status_authorizedBooleantrue, falseNo
authorization_status_unauthorizedBooleantrue, falseNo
result_type_aaa_timeoutBooleantrue, falseNo
activated_service_templatesListStringNo
authorizing_method_priority_greater_thanIntegerNo
method_dot1xBooleantrue, falseNo
result_type_method_dot1x_authoritativeBooleantrue, falseNo
result_type_method_dot1x_agent_not_foundBooleantrue, falseNo
result_type_method_dot1x_method_timeoutBooleantrue, falseNo
method_mabBooleantrue, falseNo
result_type_method_mab_authoritativeBooleantrue, falseNo
dscpListIntegerNo
access_groupStringNo
ip_dscpAnyChoice[af11, af12, af13, af21, af22, af23, af31, af32, af33, af41, af42, af43, cs1, cs2, cs3, cs4, cs5, cs6, cs7, default, dscp, ef, precedence] or Integer[min: 0, max: 63] or String[Regex: ^.*[\$\%]\{.*$]No
ip_precedenceAnyChoice[critical, flash, flash-override, immediate, internet, network, priority, routine] or Integer[min: 0, max: 7] or String[Regex: ^.*[\$\%]\{.*$]No

classes (iosxe.devices.configuration.policy.policy_maps)

Section titled “classes (iosxe.devices.configuration.policy.policy_maps)”
NameTypeConstraintMandatoryDefault Value
nameStringYes
actionsList[actions]No

events (iosxe.devices.configuration.policy.policy_maps)

Section titled “events (iosxe.devices.configuration.policy.policy_maps)”
NameTypeConstraintMandatoryDefault Value
nameStringYes
event_typeChoiceaaa-available, absolute-timeout, agent-found, authentication-failure, authentication-success, authorization-failure, authorization-success, identity-update, inactivity-timeout, remote-authentication-failure, remote-authentication-success, remote-update, session-disconnected, session-started, tag-added, tag-removed, template-activated, template-activation-failed, template-deactivated, template-deactivation-failed, timer-expiry, violationNo
match_typeChoicematch-all, match-firstNo
classesList[classes]No

actions (iosxe.devices.configuration.policy.policy_maps.classes)

Section titled “actions (iosxe.devices.configuration.policy.policy_maps.classes)”
NameTypeConstraintMandatoryDefault Value
typeChoicebandwidth, compression, dbl, drop, estimate, fair-queue, forward, netflow-sampler, police, priority, queue-buffers, queue-limit, random-detect, service-policy, set, shape, trustNo
bandwidth_bitsIntegermin: 1, max: 100000000No
bandwidth_percentIntegermin: 1, max: 100No
bandwidth_remaining_optionChoicepercent, ratioNo
bandwidth_remaining_percentIntegermin: 1, max: 100No
bandwidth_remaining_ratioIntegermin: 1, max: 65536No
priority_levelIntegermin: 1, max: 2No
priority_burstIntegermin: 32, max: 2000000No
queue_limitIntegermin: 1, max: 64000000No
queue_limit_typeAnybytes, ms, packets, usNo
shape_average_bit_rateIntegermin: 1000, max: 100000000000No
shape_average_bits_per_interval_sustainedIntegermin: 32, max: 800000000No
shape_average_bits_per_interval_excessIntegermin: 0, max: 154400000No
shape_average_percentIntegermin: 0, max: 100No
shape_average_burst_size_sustainedIntegermin: 10, max: 2000No
shape_average_msBooleantrue, falseNo
police_target_bitrate_conform_transmitBooleantrue, falseNo
police_target_bitrate_exceed_transmitBooleantrue, falseNo
police_target_bitrateIntegermin: 1, max: 100000000000No
police_target_bitrate_conform_burst_byteIntegermin: 1, max: 512000000No
police_target_bitrate_excess_burst_byteIntegermin: 1, max: 512000000No

classes (iosxe.devices.configuration.policy.policy_maps.events)

Section titled “classes (iosxe.devices.configuration.policy.policy_maps.events)”
NameTypeConstraintMandatoryDefault Value
numberIntegermin: 1, max: 254Yes
classStringYes
execution_typeChoicedo-all, do-until-failure, do-until-successNo
actionsList[actions]No

actions (iosxe.devices.configuration.policy.policy_maps.events.classes)

Section titled “actions (iosxe.devices.configuration.policy.policy_maps.events.classes)”
NameTypeConstraintMandatoryDefault Value
numberIntegermin: 1, max: 254Yes
pause_reauthenticationBooleantrue, falseNo
authorizeBooleantrue, falseNo
terminate_configAnyChoice[dot1x, mab, webauth] or String[Regex: ^.*[\$\%]\{.*$] or String[Regex: ^.*[\$\%]\{.*$]No
activate_service_template_config_service_templateStringNo
activate_service_template_config_aaa_listStringNo
activate_service_template_config_precedenceIntegermin: 1, max: 254No
activate_service_template_config_replace_allBooleantrue, falseNo
activate_interface_templateStringNo
activate_policy_type_control_subscriberStringNo
deactivate_interface_templateStringNo
deactivate_service_templateStringNo
deactivate_policy_type_control_subscriberStringNo
authenticate_using_methodChoicedot1x, mab, webauthNo
authenticate_using_retriesIntegermin: 1, max: 5No
authenticate_using_retry_timeIntegermin: 0, max: 65535No
authenticate_using_priorityIntegermin: 1, max: 254No
authenticate_using_aaa_authc_listStringNo
authenticate_using_aaa_authz_listStringNo
authenticate_using_bothBooleantrue, falseNo
authenticate_using_parameter_mapStringNo
replaceBooleantrue, falseNo
restrictBooleantrue, falseNo
clear_sessionBooleantrue, falseNo
clear_authenticated_data_hosts_on_portBooleantrue, falseNo
protectBooleantrue, falseNo
err_disableBooleantrue, falseNo
resume_reauthenticationBooleantrue, falseNo
authentication_restartIntegermin: 1, max: 65535No
set_domainChoicedata, switch, voiceNo
unauthorizeBooleantrue, falseNo
notifyBooleantrue, falseNo
set_timer_nameStringNo
set_timer_valueIntegermin: 0, max: 65535No
map_attribute_to_service_tableStringNo

By defining class-maps and policy-maps, policy configuration enables granular traffic classification, prioritization, and enforcement for QoS and access control.

Key Components:

  • Class-Map Name (class_maps.name): The identifier for the class-map.

  • Class-Map Type (class_maps.type): Specifies the class-map type (QoS, control, inspect).

  • Class-Map Match Criteria (class_maps.match): Defines match conditions (DSCP, protocol, access-group, authorization status, method).

  • Policy-Map Name (policy_maps.name): The identifier for the policy-map.

  • Policy-Map Type (policy_maps.type): Specifies the policy-map type (QoS, control, inspect).

  • Policy-Map Classes (policy_maps.classes): Associates classes with the policy-map.

  • Policy-Map Actions (policy_maps.classes.actions): Specifies actions (bandwidth, priority, queue-limit, authorize, activate service template, redirect).

  • Events (policy_maps.events): Defines events for control policies.

  • Description (description): Descriptive text for class-maps and policy-maps.

Key Parameters Briefly Explained:

  • class_maps.name: Class-map identifier.
  • class_maps.type: Class-map type.
  • class_maps.match: Match conditions.
  • policy_maps.name: Policy-map identifier.
  • policy_maps.type: Policy-map type.
  • policy_maps.classes: Classes in the policy-map.
  • policy_maps.classes.actions: Actions for matched traffic.
  • policy_maps.events: Control policy events.
  • description: Description for class-map or policy-map.

You can use these Policy parameters to define granular traffic classification and enforcement rules. Customize class-map match conditions and policy-map actions to fit your network’s QoS requirements, access control policies, and traffic engineering needs. Adjusting these parameters lets you tailor how traffic is identified, prioritized, and processed across your network infrastructure.

The following configuration describes how to set up QoS and control policies on a Cisco IOS-XE device, including class-maps for DSCP values and authentication status, and policy-maps for QoS actions and access control.

class-map match-all VOICE-CLASS
description Voice traffic classification
match dscp 46
!
class-map match-all VIDEO-CLASS
description Video traffic classification
match dscp 34 36 38
!
class-map type control subscriber CONTROL-CLASS
match authorization-status authorized
match method dot1x
match result-type method dot1x authoritative
!
policy-map WAN-QOS-POLICY
description WAN QoS policy with voice and video prioritization
class VOICE-CLASS
priority level 1
priority-burst 8000
class VIDEO-CLASS
bandwidth percent 30
queue-limit 64 packets
!
policy-map type control subscriber ACCESS-CONTROL-POLICY
description Network access control policy
event authentication-success match-first
class CONTROL-CLASS
do-all
1 authorize
2 activate service-template USER-TEMPLATE

The following YAML code defines QoS and control policies on an IOS-XE device, specifying class-maps with match criteria and policy-maps with actions and events.

iosxe:
devices:
- name: Device1
configuration:
policy:
class_maps:
- name: VOICE-CLASS
prematch: match-all
description: Voice traffic classification
match:
dscp: [46]
- name: VIDEO-CLASS
prematch: match-all
description: Video traffic classification
match:
dscp: [34, 36, 38]
- name: CONTROL-CLASS
type: control
subscriber: true
match:
authorization_status_authorized: true
method_dot1x: true
result_type_method_dot1x_authoritative: true
policy_maps:
- name: WAN-QOS-POLICY
description: WAN QoS policy with voice and video prioritization
classes:
- name: VOICE-CLASS
actions:
- type: priority
priority_level: 1
priority_burst: 8000
- name: VIDEO-CLASS
actions:
- type: bandwidth
bandwidth_percent: 30
- type: queue-limit
queue_limit: 64
queue_limit_type: packets
- name: ACCESS-CONTROL-POLICY
type: control
subscriber: true
description: Network access control policy
events:
- name: authentication-success
event_type: authentication-success
match_type: match-first
classes:
- number: 1
class: CONTROL-CLASS
execution_type: do-all
actions:
- number: 1
authorize: true
- number: 2
activate_service_template_config_service_template: USER-TEMPLATE