Creating a policy based on IP address

This procedure creates a DSCP policy for IP packets carrying the selected IP address (source or destination).

Procedure
  1. Identify the IPv4 or IPv6 address to use as a classifier for assigning a DSCP policy.
  2. Determine the DSCP policy for packets carrying the selected IP address:
    1. Determine the DSCP you want to assign to the selected packets. (This codepoint will be used to overwrite the DSCP carried in packets received from upstream devices.)

    2. Determine the 802.1p priority you want to assign to the DSCP.

  3. If necessary, use the qos dscp-map codepoint priority 0 - 7 command to configure the DSCP policy (codepoint and associated 802.1p priority) that you want to use to mark matching packets.

    Prerequisite: A DSCP codepoint must have a preconfigured 802.1p priority (0 - 7) to use the codepoint to mark matching packets. If a codepoint shows No-override in the Priority column of the DSCP Policy table (show qos dscp-map command), first configure a priority for the codepoint before proceeding (qos dscp-map priority command).

    qos dscp-map codepoint priority0 - 7

    Optional: this command is required only if an 802.1p priority is not already assigned to the specified codepoint in the DSCP Policy table, see Table 27: The default DSCP policy table.

    When the switch applies this policy to a packet, the priority determines the packet's queue in the outbound port to which it is sent. If the packet leaves the switch on a tagged port, it carries the 802.1p priority with it to the next downstream device. For IP packets, the DSCP will be replaced by the codepoint specified in this command.

    Default: No-override for most codepoints.

  4. Configure the switch to assign the DSCP policy to packets with the specified IP address or subnet mask.
    
    qos device-priority [ipv4-address | [ipv4 ipv4-address/mask-length]] dscpcodepoint
    
    
    qos device-priority [ipv6-address | ipv6 ipv6-address/mask-length] dscp codepoint
    

    Assigns a DSCP policy in packets with the specified IP address or subnet mask in the source or destination field in a packet header, where:

    • ipv4-address
      or ipv6-address is an IPv4 or IPv6 address used to match the source or destination address in packet headers.
      NOTE:

      An IPv6 local-link address (such as fe80::110:252%vlan20) that is automatically generated on a VLAN interface is not supported as an ipv6-address value.

    • [ipv4] ipv4-address/mask-length

      is the subnet identified by the IPv4 mask for the specified address that is used to match the IPv4 in the source or destination field of packet headers.

    • ipv6 ipv6-address/prefix-length

      is the subnet identified by the IPv6 prefix-length for the specified address that is used to match the IPv6 address in the source or destination field of packet headers.

      Enter the IPv4 mask or IPv6 prefix length with an address in CIDR format by using the number of significant bits (for example, 2001:db8:2:1:262:a03:e102:127/64 or 10.28.31.1/24).

    • dscp codepoint
      overwrites the DSCP codepoint in the IPv4 ToS byte or IPv6 Traffic Class byte of matching packets with the specified value. Valid values for the DSCP codepoint are as follows:
      • A binary value for the six-bit codepoint from 000000 to 111111.

      • A decimal value from 0 (low priority) to 63 (high priority) that corresponds to a binary DSCP bit set

      • An ASCII standard name for a binary DSCP bit set Enter ? to display the list of valid codepoint entries.

        The DSCP value you enter must be currently associated with an 802.1p priority in the DSCP Policy table (see Table 27: The default DSCP policy table). The 802.1p priority and determines the packet's queue in the outbound port to which it is sent. If the packet leaves the switch on a tagged port, it carries the 802.1p priority with it to the next downstream device. The default DSCP codepoint is No-override. The DSCP codepoint is not overwritten in matching packets.

        The no form of the command deletes the specified IP address or subnet mask as a QoS classifier. If you configured a subnet mask as match criteria, you must enter the entire IP address and mask-length in the no command.

    
    show qos device-priority
    

    Displays a listing of all IP addresses and subnet masks used as QoS classifiers currently in the running-config file.