Cisco 3550 QOS 端口限速配置
- 格式:doc
- 大小:29.00 KB
- 文档页数:2
cisco qos限速cisco qos限速有网友这么问小编“cisco qos限速怎么设置?”,店铺在网上搜索了一些资料,供大家参考。
qos介绍在Cisco IOS 系统上作QOS,一般要有以下五步:1、启用全局qos2、设置ACL匹配的流量3、设置一个class-map,来匹配第二步设置的ACL4、设置一个policy-map匹配class-map,然后再在这里面定义一系列策略5、将policy-map应用到相应的接口上解注:1、交换机默认情况下qos是disable,所以在应用qos时,必须先启用它,可以在全局模式下启用,命令为:switch(config)#mls qos,查看交换机qos状态可用show mls qos2、定义一条ACL,这条ACL可以是标准的,可以是扩展的,可以是命名的,1-99是标准ACL命名列表,100以上是扩展的ACL命名列表,个人喜欢用自定义ACL,除了精确外,也最明了。
3、class map是一个分类表,它要包含某条ACL。
具体格式为switch (config)#class-map [match-all|match-any] {map-name} 交换机默认的策略为match-all,匹配所有,所以命令可以简化为switch (config)#class-map map145-to-134match-any,表示至少符合一个条件4、protocal map,定义一个策略表,这个策略要包含第三步定义的class表,并且限制的带宽要在此明确指定5、进入接口视图,应用策略,接口一般指端口,不能在vlan接口去应用QOS。
这里要注意数据流有入,出之分,在应用时要注意,数据是从哪到哪里,否则控制无效,如果实在是不清楚数据流走向,可以在IN方向和OUT方向作双向控制。
注意一点:应用QOS时,要弄清一个概念,那就是QOS机制不能与flowcontrol(流控制)功能共存在同一个端口上,交换机端口是10/100/1000,所以有些场景,在交换机的端口上会简单应用flowcontrol命令来进行限速。
以前端口限速的工作都是由上级部门来做,最近由于分公司自己的内部客户需求,我们要为其提供50M的带宽.为此我们可是煞费苦心作了两天的测试,先来说说我们测试的设备连接情况:思科3560端口0/47(模拟用户)——————思科6509端口0/1、0/2(模拟局端,两条路有上联,热备)测试方法在3560及6509上分别起ftp进行测速重点来了,来说说6509上的命令吧:mls qos aggregate-policer test 50000000 100000 conform-action transmit exceed-action dropmls qosclass-map match-any test_limitematch access-group name test_addr!!policy-map rate-limit-uplinkclass test_limitepolice aggregate testip access-list extended test_addr (因为上下行都引用策略一样因此不单独做acl)permit ip any x.x.x.x 0.0.0.3 (分配给用户的互联网地址段A)permit ip x.x.x.x 0.0.0.3 anypermit ip any x.x.x.x 0.0.0.3 (分配给用户的互联网地址段B)permit ip x.x.x.x 0.0.0.3 anyinter f0/1ip addre x.x.x.x 255.255.255.252service-policy input test_uplink限制上传inter f0/2ip addre x.x.x.x 255.255.255.252service-policy input test_uplink限制上传inter g0/47service-policy input rate-limit-uplink限制下载经过测试,这个方案成功了!!哈哈,庆祝庆祝,有几点需要解释一下,因为35和65只有在input方向才能引用策略,所以同时对上行和下载作限速需要在上联和下载两方向的端口上做其次,我们中间有很多弯路,说来给大家提个醒,开始我们用的测试设备性能很低,所以始终测试不出理想的结果,很泄气,无意中拿了班上最好的一台电脑去测试,结果居然出人意料,后来又找了一台高性能设备进行测试,结果非常理想,在此提醒大家,低性能的设备在测试高带宽的时候要特别注意。
cisco路由器限制速度的方法关于思科cisco路由器的限速方法,下面店铺就为大家介绍一下具体的方法吧,欢迎大家参考和学习。
具体的限制速度方法步骤如下:1、设置ACLaccess-list 102 permit ip host 192.168.10.2 anyaccess-list 102 permit ip any host 192.168.10.2access-list 103 permit ip host 192.168.10.3 anyaccess-list 103 permit ip any host 192.168.10.32、定义类class-map match-all 102match access-group 102class-map match-all 103match access-group 1033、将类加入策略中policy-map xiansuclass 102police 1024000 128000 conform-action transmit exceed-action dropclass 103police 1024000 128000 conform-action transmit exceed-action drop4、将策略加入端口中interface FastEthernet0/0service-policy input xiansutestservice-policy output xiansutest针对某个网段进行限速(限定的是总带宽)(1)设置ACLaccess-list 110 permit ip 192.168.10.0 0.0.0.255 anyaccess-list 102 permit ip any 192.168.10.0 0.0.0.255(2)定义类class-map match-all 110match access-group 110(3)设置策略policy-map xiansu110class 110police 10240000 1280000 conform-action transmit exceed-action drop(4)将策略加入端口interface FastEthernet0/0service-policy input xiansu110service-policy output xiansu110。
cisco限速cisco怎么才能进行设置限速??有网友提到自己不会设置思科的设备,该怎么办?店铺在网上找了一些教程及命令,需要的朋友可以参考下。
连接cisco(1)连接线缆连接到控制端口我们需要一根rollover线缆和RJ-45转DB-9的适配器,这一般在思科路由器的产品附件中我们可以见到。
(2)终端仿真软件PC或者终端必须支持vt100仿真终端,通常我们在Windows OS 环境下都使用的是HyperTerminal软件。
(3)将PC连接到路由器上1、配置终端仿真软件参数,如下图:2、将rollover线缆的一端连接到路由器的控制端口。
3、将rollover线缆的一端连接到RJ-45到DB-9的转换适配器。
4、将DB-9适配器的另一端连接到PC。
cisco限速在具体接口下执行以下命令:rate-limit input 2048000 8000 16000 conform-action transmit exceed-action droprate-limit output 2048000 8000 16000 conform-action transmit exceed-action drop释义:2048000----Bits per secondBPS:比特/秒 (BITS PER SECOND):信息传输的比特率。
8000----Normal burst bytes正常突发流量16000----- Maximum burst bytes最大突发流量conform-action-----符合规则的所采取的动作为transmit -----传输exceed-action------超越范围的所采取的动作为drop-----丢弃在Cisco设备中,只有支持思科快速转发(CEF,Cisco Express Forward)的路由器或交换机才能使用rate-limit来限制流量,具体设置分三步1. 在全局模式下开启cef:configure terminalRouter(config)#ip cef2. 定义标准或者扩展访问列表(定义一个方向就可以了):Router(config)#access-list 111 permit ip 192.168.1.0 0.0.0.255 any3. 在希望限制的端口上进行rate-limit:Router(config)#interface FastEthernet 0/1Rounter(config-if)#rate-limit input access-group 111 2000000 40000 60000 conform-action transmit exceed-action drop这样我们就对192.168.1.0网段进行了限速,速率为2Mbps。
Cisco三层交换的限速拓扑:pc1-------default vlan 1--3550-24-emi--f0/24-------pc2 配置:pc1:192.168.1.7 255.255.255.0 192.168.1.222vlan 1:192.168.1.222 255.255.255.0f0/24:192.168.2.1 255.255.255.0pc2:192.168.2.20 255.255.255.0 192.168.2.1交换机的情况:Switch#sh runBuilding configuration...Current configuration : 1835 bytes!version 12.1no service padservice timestamps debug uptimeservice timestamps log uptimeno service password-encryption!hostname Switch!!ip subnet-zeroip routingmls qos!class-map match-all 64kmatch access-group 110!!policy-map yikaiclass 64kpolice 512000 32000 exceed-action drop !!spanning-tree extend system-id!!!interface FastEthernet0/1switchport mode accessno ip addressservice-policy input yikai!interface FastEthernet0/2 no ip address!interface FastEthernet0/3 no ip address!interface FastEthernet0/4 no ip address!interface FastEthernet0/5 no ip address!interface FastEthernet0/6 no ip address!interface FastEthernet0/7 no ip address!interface FastEthernet0/8 no ip address!interface FastEthernet0/9no ip address!interface FastEthernet0/10 no ip address!interface FastEthernet0/11 no ip address!interface FastEthernet0/12 no ip address!interface FastEthernet0/13 no ip address!interface FastEthernet0/14 no ip address!interface FastEthernet0/15 no ip address!interface FastEthernet0/16 no ip address!interface FastEthernet0/17 no ip address!interface FastEthernet0/18 no ip address!interface FastEthernet0/19 no ip address!interface FastEthernet0/20 no ip address!interface FastEthernet0/21 no ip address!interface FastEthernet0/22 no ip address!interface FastEthernet0/23 no ip address!interface FastEthernet0/24no switchportip address 192.168.2.1 255.255.255.0service-policy input yikai!interface GigabitEthernet0/1no ip address!interface GigabitEthernet0/2no ip address!interface Vlan1ip address 192.168.1.222 255.255.255.0!ip classlessip http server!access-list 110 permit ip host 192.168.2.20 any access-list 110 permit ip any any!line con 0line vty 0 4loginline vty 5 15login!end此时在客户机pc2从pc1上拷贝文件,大约40M时间大约:12分钟Switch#sh mls qos interface f 0/1 staFastEthernet0/1Ingressdscp: incoming no_change classified policed dropped (in bytes)Others: 385021895 385021895 0 0 12197478Egressdscp: incoming no_change classified policed dropped (in bytes)Others: 9553871 n/a n/a 0 0Switch#sh mls qos interface f 0/1 staFastEthernet0/1Ingressdscp: incoming no_change classified policed dropped (in bytes)Others: 385369437 385369437 0 0 12259540Egressdscp: incoming no_change classified policed dropped (in bytes)Others: 9562103 n/a n/a 0 0从中发现有大量的dropped,且增加很快.如果在interface f 0/1no service-map input yikai则没有应用policy-map yikai ,此时同样的文件传速速度很快,大约只需要3分钟.华为交换机的限速支持端口限速的,针对以太网端口的入方向用traffic-limit命令,粒度为8kbps.出方向可用流量整形功能,traffic-shape命令。
交换机简介⏹连接方式Telnet、WebBrower、网管软件、console(控制线)⏹性能参数基本配置⏹状态转换⏹用户属性及密码修改⏹查看MAC地址#show mac-address-table⏹端口基本配置(单/组)speed/duplexDescription⏹保存或更改设置#copy running-configure startup-configure#delete flash:vlan.dat#erase startup-configure#reload⏹MAC地址配置使用说明⏹命令缩写⏹?及Tab键的使用⏹为防止由于输入的命令错误引起的等待,禁止设备查找DNS服务器#no ip domain-lookup;⏹有效的范围:vlan从1 到4094fastethernet槽位/{first port} - {last port}, 槽位为0gigabitethernet槽位/{first port} - {last port},槽位为0⏹端口优先及通常为4096的倍数,而权植为16的倍数;VLAN配置⏹VLAN 简介⏹创建VLAN(基于静态端口)新建划分端口⏹查看VLAN配置⏹删除VLAN⏹问题:物理端口与可支持VLAN数目不相匹配;⏹命令行:switch>enswitch #vlan database //新建Vlan1switch (vlan)vlan 1name VLAN1switch #configure terminalswitch (config)int g0/1 //划分端口g0/1switch(config-if)switch mode accessswitch(config-if)switch access vlan 1TRUNK设置⏹TRUNK简介⏹数据封装类型dot1islnegotiate⏹配置trunk⏹定义trunk允许通过的vlan switch trunk allowed vlan …⏹Native vlan 意义及更改(如果trunk链路两端的native vlan不一致时,交换机将会报错)⏹DTP简介对于CISCO交换机之间的链路是否形成TRUNK,可以通过DTP(Dynamic Trunk Protocol)进行协商。
cisco3550 端口限速配置一、网络说明PC1接在Cisco3550 F0/1上,速率为1M;PC1接在Cisco3550 F0/2上,速率为2M;Cisco3550的G0/1为出口。
二、详细配置过程注:每个接口每个方向只支持一个策略;一个策略可以用于多个接口。
因此所有PC的下载速率的限制都应该定义在同一个策略(在本例子当中为policy-map user-down),而PC不同速率的区分是在Class-map分别定义。
1、在交换机上启动QOSSwitch(config)#mls qos //在交换机上启动QOS2、分别定义PC1(10.10.1.1)和PC2(10.10.2.1)访问控制列表Switch(config)#access-list 10 permit 10.10.1.0 0.0.0.255 //控制pc1上行流量Switch(config)#access-list 100 permit any 10.10.1.0 0.0.0.255 //控制pc1下行流量Switch(config)#access-list 11 permit 10.10.2.0 0.0.0.255 //控制pc2上行流量Switch(config)#access-list 111 permit any 10.10.2.0 0.0.0.255 //控制pc2下行流量3、定义类,并和上面定义的访问控制列表绑定Switch(config)# class-map user1-up //定义PC1上行的类,并绑定访问列表10Switch(config-cmap)# match access-group 10Switch(config-cmap)# exitSwitch(config)# class-map user2-upSwitch(config-cmap)# match access-group 11 //定义PC2上行的类,并绑定访问列表10 Switch(config-cmap)# exitSwitch(config)# class-map user1-downSwitch(config-cmap)# match access-group 100 //定义PC1下行的类,并绑定访问列表100 Switch(config-cmap)# exitSwitch(config)# class-map user2-downSwitch(config-cmap)# match access-group 111 //定义PC2下行的类,并绑定访问列表111 Switch(config-cmap)# exit4、定义策略,把上面定义的类绑定到该策略Switch(config)# policy-map user1-up //定义PC1上行的速率为1MSwitch(config-pmap)# class user1-upSwitch(config-pmap-c)# trust dscpSwitch(config-pmap-c)# police 1024000 1024000 exceed-action dropSwitch(config)# policy-map user2-up //定义PC2上行的速率为2M Switch(config-pmap)# class user2-upSwitch(config-pmap-c)# trust dscpSwitch(config-pmap-c)# police 2048000 1024000 exceed-action drop Switch(config)# policy-map user-downSwitch(config-pmap)# class user1-downSwitch(config-pmap-c)# trust dscpSwitch(config-pmap-c)# police 1024000 1024000 exceed-action drop Switch(config-pmap-c)# exitSwitch(config-pmap)# class user2-downSwitch(config-pmap-c)# trust dscpSwitch(config-pmap-c)# police 2048000 1024000 exceed-action drop Switch(config-pmap-c)# exit5、在接口上运用策略Switch(config)# interface f0/1Switch(config-if)# service-policy input user1-upSwitch(config)# interface f0/2Switch(config-if)# service-policy input user2-up Switch(config)# interface g0/1Switch(config-if)# service-policy input user-down。
Cisco3550的配置命令手册为了使两个或多个交换机在同一个MST区域,你必须有相同的VLAN到实例映射,相同的配置修正号,和相同的名字。
从特权模式开始,跟着这些步骤指派MST区域配置和启用MSTP。
这个过程是必需的。
命令目的Step 1 configure terminal 进入全局配置模式Step 2 spanning-tree mst configuration 进入MST配置模式Step 3 instance instance-id vlan vlan-range 映射VLAN到一个MST实例对于instance-id, 范围从1到15。
对于vlan vlan-range, 范围从1到4094。
当你映射一个VLAN到MST实例, 映射增大, 并且被指定的VLAN 范围被增加或被移动到现有的一个实例当中。
为了指定一个范围, 使用一个连字号;例如, instance 1 vlan 1-63 映射VLAN1至63到MST实例1。
为指定一个系列, 使用一个逗号;例如, instance 1 vlan 10, 20, 30 映射VLAN10,20,和30到MST 实例1.Step 4 name name 指定配置名。
该name 字符串有最大32个字符串并区分大小写。
Step 5 revision version 指定配置修订号数字. 范围是0到65535.Step 6 show pending 显示等待配置来确认你的配置Step 7 exit 应用所有改变, 并返回到全局配置模式.Step 8 spanning-tree mode mst 起用MSTP。
RSTP 也被启用。
注意改变生成树模式会中断流量,因为所有以前的生成树实例被停止,并启用一个新的生成树实例。
在同一时间,你不能同时运行MSTP和PVSTStep 9 end 返回特权模式Step 10 show running-config 确认你的条目Step 11 copy running-config startup-config (可选)在配置文件中保存你的条目为了返回缺省MST区域配置,使用命令:(global) no spanning-tree mst configuration为了返回缺省VLAN实例映射,使用命令:(config-mst) no instance instance-id [vlan vlan-range]为了返回缺省名,使用命令:(config-mst) no name为了返回缺省修正号,使用命令:(config-mst) no revision为了重新启用PVST,使用命令:(config) spanning-tree mode pvst这个例子显示怎样进入MST配置模式,映射VLAN10-20进入MST实例1,命名区域region1,设置配置修正号1,显示挂起的配置,应用变化,并且返回全局配置模式:Switch(config)# spanning-tree mst configurationSwitch(config-mst)# instance 1 vlan 10-20Switch(config-mst)# name region1Switch(config-mst)# revision 1Switch(config-mst)# show pendingPending MST configurationName [region1]Revision 1Instance Vlans Mapped-------- ---------------------0 1-9,21-40941 10-20-------------------------------Switch(config-mst)# exitSwitch(config)#配置根交换机交换机为映射到他的VLANs保持一个生成树实例。
Cisco 3550 QOS 端口限速配置
一、网络说明
PC1接在Cisco3550 F0/1上,速率为1M;
PC2 接在Cisco3550 F0/2上,速率为2M;
Cisco3550的G0/1为出口。
二、详细配置过程
注:每个接口每个方向只支持一个策略;一个策略可以用于多个接口。
因此所有PC的下载速率的限制都应该定义在同一个策略(在本例子当中
为policy
1、在交换机上启动QOS
Switch(config)#mls qos //在交换机上启动QOS
2、分别定义PC1(10.10.1.1)和PC2(10.10.2.1)访问控制列表
Switch(config)#access-list 10 permit 10.10.1.0 0.0.0.255 //控制pc1上行流量Switch(config)#access-list 100 permit any 10.10.1.0 0.0.0.255 //控制pc1下行流量Switch(config)#access-list 11 permit 10.10.2.0 0.0.0.255 //控制pc2上行流量Switch(config)#access-list 111 permit any 10.10.2.0 0.0.0.255 //控制pc2下行流量
3、定义类,并和上面定义的访问控制列表绑定
Switch(config)# class-map user1-up //定义PC1上行的类,并绑定访问列表10 Switch(config-cmap)# match access-group 10
Switch(config-cmap)# exit
Switch(config)# class-map user2-up
Switch(config-cmap)# match access-group 11 //定义PC2上行的类,并绑定访问列表10
Switch(config-cmap)# exit
Switch(config)# class-map user1-down
Switch(config-cmap)# match access-group 100 //定义PC1下行的类,并绑定访问列表100
Switch(config-cmap)# exit
Switch(config)# class-map user2-down
Switch(config-cmap)# match access-group 111 //定义PC2下行的类,并绑定访问列表111
Switch(config-cmap)# exit
4、定义策略,把上面定义的类绑定到该策略
Switch(config)# policy-map user1-up //定义PC1上行的速率为1M
Switch(config-pmap)# class user1-up
Switch(config-pmap-c)# trust dscp
Switch(config-pmap-c)# police 1024000 1024000 exceed-action drop
Switch(config)# policy-map user2-up //定义PC2上行的速率为2M Switch(config-pmap)# class user2-up
Switch(config-pmap-c)# trust dscp
Switch(config-pmap-c)# police 2048000 1024000 exceed-action drop Switch(config)# policy-map user-down
Switch(config-pmap)# class user1-down
Switch(config-pmap-c)# trust dscp
Switch(config-pmap-c)# police 1024000 1024000 exceed-action drop Switch(config-pmap-c)# exit
Switch(config-pmap)# class user2-down
Switch(config-pmap-c)# trust dscp
Switch(config-pmap-c)# police 2048000 1024000 exceed-action drop Switch(config-pmap-c)# exit
5、在接口上运用策略
Switch(config)# interface f0/1
Switch(config-if)# service-policy input user1-up
Switch(config)# interface f0/2
Switch(config-if)# service-policy input user2-up
Switch(config)# interface g0/1
Switch(config-if)# service-policy input user-down。