class-map and policy-map config

class-map match-all a
 match input-interface FastEthernet0/0

policy-map a
 class a
  set ip precedence 5
interface FastEthernet0/0
 service-policy output a

二层匹配来自相接的对端设备接口MAC地址流量
class-map B
 match source-add mac 0c00.41fc.0000
policy-map B
 class B
  set ip dscp ef
int f0/0
 service-policy input B

依赖四层或者高层信息来做marking
class-map match-any apple
match access-group name tcp
match access-group name udp
ip access-list extended tcp
permit tcp any host 44.1.1.1
policy-map apple
class apple
set ip precedence 4
int f0/0
service-policy input apple

show policy-map int

class-map match-all C1
match protocol icmp
class-map match-all C2
match ip recedence 1
policy-map P1
class C1
bandwidth 20000 分配带宽为20Mb/s
class C2
bandwidth 30000
int f0/0
service-policy output P1

show policy-map
show int f0/0

在默认情况下,可用带宽是总带宽的75%。

用百分比方式来配置CB-WFQ

policy-map P1
class C1
bandwidth percent 20
class C2
bandwidth percent 30
class C3
bandwidth remaining percent 20 (剩余方式)
int f0/0
service-policy output P1
对默认分类的修改从默认的FIFO队列改为WFQ队列。
policy-map P1
class class-default
fair-queue
修改CB-WFQ可以占用的带宽数值(默认为75%):
int f0/0
max-reserved-bandwidth 100

采用MQC的方式配置基本的CB-LLQ
ip access-list extended telnet
permit tcp host 12.1.1.1 host 12.1.1.2 eq 23
class-map telnet
match access-group name telnet
policy-map telnet
priority 8 //代表8KB。
int f0/0
service-policy output telnet

采用带宽百分比的方式配置低延时队列
policy-map telnet
class telnet
priority percent 10


CB-WRED基于类的WRED

ip access-list extended udp
permit ip any any precedence 5
permit udp any any eq ntp
class-map match-any udp
match access-group name udp
policy-map WRED
class udp
bandwidth percent 10
random-detect
int f0/0
service-policy output WRED

 

posted @ 2017-03-05 11:07  myway_liang  阅读(537)  评论(0编辑  收藏  举报