Cisco 交换机QOS配置模板

419阅读 0评论2011-12-14 wfeng
分类:系统运维

police

在class 模式下使用此命令为该数据流中定义policer,目前的policer 支持限制该数据流的带宽和为带宽超限部分指定处理动作。

police rate-bps burst-byte [exceed-action{drop | dscp dscp-value}]

rate-bps 每秒钟的带宽限制量,

对于10/100M 以太网接口来说取值范围是1~100Mbsp,

对于1000M 以太网接口来说取值范围是8~1000Mbsp。

burst-byte 猝发流量限制值,单位是比特(byte)。

exceed-action drop 丢弃带宽超限部分的报文。

exceed-action dscp dscp-value 改写带宽超限部分报文的DSCP 值。

dscp-value 的取值范围是0, 8, 10, 16, 18, 24, 26, 32, 34, 40, 46, 48, 56.

缺省值缺省没有设置任何policer。

命令模式class 配置模式。

使用指导目前的policer 支持限制该数据流的带宽和为带宽超限部分指定处理动作;rate-bps是每秒钟的带宽限制量,对于10/100M 以太网接口来说取值范围是1~100Mbsp,对于1000M 以太网接口来说取值范围是8~1000Mbsp; burst-byte是猝发流量限制值,单位是比特(byte)。

您可以在命令中指定关键字drop 来丢弃带宽超限部分的报文;您也可以在命令各种指定dscp

dscp-value来改写带宽超限部分报文的DSCP 值;

使用show policy-map 命令查看设置。

配置示例:

(config)#access-list 15 permit tcp host 192.1.1.1

Switch(config)#class-map class1

Switch(config-cmap)#match access-group 15

Switch(config-cmap)#exit

Switch(config)# policy-map policy1

Switch(config-pmap)#class class1

Switch(config-pmap-c)#police 100000 exceed-action dscp 22

Switch(config-pmap-c)#set ip dscp 8

Switch(config-pmap-c)#exit

Switch(config-pmap)#exit

Switch(config)#interface fastethernet 0/2

Switch(config-if)#service-policy input policy

命令描述

class-map 创建一个class map,并进入class map 配置模式。

match access-group 创建一个class map 的匹配标准。

policy-map 创建一个policy map,并进入policy map 配置模式。

class 创建一个在该policy map 中使用的数据分类,并进入数

据分类配置模式。

set ip dscp 为该数据流中的IP 报文设置新的ip dscp 值。

相关命令

show policy-map 显示一个QoS policy map 实体的内容。

 

policy-map

创建一个policy map,并进入policy map 配置模式。使用该命令的no 选项删除policy map。

policy-map policy-map-name

no policy-map policy-map-name

语法描述policy-map-name policy map 的名字。

缺省值缺省没有设置任何policy map。

使用指导使用show policy-map 命令查看设置。

范例以下的设置步骤创建了一个名为policy1 的policy-map:并进入policy-map 模式:

Switch(config)# policy-map policy1

Switch(config-pmap)#

命令描述

show policy-map 显示一个QoS policy map 实体的内容。

 

 

 

 

例:带宽限制为2M,burst-byte是猝发流量限制值32768 (32K burst bytes)

 

配置模版:

 

config t

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#policy-map test

2006-04-10 08:45:40 @5-CONFIG:Configured from outband

Switch(config-pmap)#exit

2006-04-10 08:45:42 @5-CONFIG:Configured from outband

Switch(config)#class test1

2006-04-10 08:45:57 @5-CONFIG:Configured from outband

Switch(config-cmap)#exit

2006-04-10 08:46:07 @5-CONFIG:Configured from outband

Switch(config)#policy-map test

2006-04-10 08:46:15 @5-CONFIG:Configured from outband

Switch(config-pmap)#class test1

2006-04-10 08:46:22 @5-CONFIG:Configured from outband

Switch(config-pmap-c)#police ?

<1000000-1000000000>   Bits per second (1M - 100M and multiple of 1M for

                         ports on static module; 8M - 1000M and multiple of 8M

                         for portson dynamic module)

 

Switch(config-pmap-c)#police 2000000 ?

131072                 128K burst bytes (valid for only Gigabit ports)

16384                  16K burst bytes

262144                 256K burst bytes (valid for only Gigabit ports)

32768                  32K burst bytes

4096                   4K burst bytes

524288                 512K burst bytes (valid for only Gigabit ports)

65536                  64K burst bytes

8192                   8K burst bytes

 

Switch(config-pmap-c)#police 2000000 32768 ?

exceed-action          When the specified rate is exceeded, specify that the

                         switch actions

                  

               

 

Switch(config-pmap-c)#police 2000000 32768

2006-04-10 08:57:31 @5-CONFIG:Configured from outband

Switch(config-pmap-c)#end

2006-04-10 08:58:01 @5-CONFIG:Configured from outband

Switch#wr

Building configuration...

[OK]

Switch#show policy-map

 

Policy Map Name: test

Class Map Name: test1

    Rate bps limit(bps): 2000000

    Burst byte limit(byte): 32768

    Exceed-action: drop

 

Switch#config t

Switch(config)#interface f 0/2

Switch(config-if)#service-policy input test

2006-04-10 09:18:20 @5-CONFIG:Configured from outband

Switch(config-if)#end

2006-04-10 09:18:26 @5-CONFIG:Configured from outband

Switch#show policy-map

 

Policy Map Name: test

Class Map Name: test1

    Rate bps limit(bps): 2000000

    Burst byte limit(byte): 32768

    Exceed-action: drop

 

Switch#

 

 

 

s2126g配置实例:

 

Building configuration...

Current configuration : 3292 bytes

 

!

version 1.0

!

hostname Switch

vlan 1

!

vlan 539

!

vlan 601

.

.

.

.

vlan 620

!

ip access-list extended qos

permit ip any any

!

class-map qos

match access-group qos

!

policy-map qos

class qos

police 8000000 131072

!

interface fastEthernet 0/1

dot1x port-control auto

dot1x dynamic-vlan enable

.

 

interface fastEthernet 0/24

dot1x port-control auto

dot1x dynamic-vlan enable

 

!

interface gigabitEthernet 2/1

switchport mode trunk

service-policy input qos

!

end



CCIE Security 2009 IOS防火墙合集


上一篇:Cisco 浮动静态路由
下一篇:QOS car 命令解释