cisco交换机端口限速文档整理(全)_第1页
cisco交换机端口限速文档整理(全)_第2页
cisco交换机端口限速文档整理(全)_第3页
cisco交换机端口限速文档整理(全)_第4页
cisco交换机端口限速文档整理(全)_第5页
已阅读5页,还剩13页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、交换机端口限速总结:by micro_请大家互相学习,如有不正,请发Email给我指出交换机端口限速总结By micro_目录引言:-1 -第一类:CISCO 3550三层交换机上的标准限速配置方法 -2 -一、 结构说明 -2 -二、详细配置过程 -2 -第二类:CISCO 3550三层交换机上更简单的限速方法 -4 -配置风暴控制 (storm control) 详谈 -4 -第三类:CISCO 3550三层交换机具体配置方法 -6 -第四类:关于二层交换机 CISCO2960上的限速配置方法 -11 -1、 2960交换机所需要进行的配置项目 -11

2、-2、 2960交换机配置时的注意事项 -11 -3、 2960交换机的配置流程 -11 -第五类:关于其它二层交换机上的限速配置方法 -14 -cisco 2950二层交换机如何限速? - 14 -三层和路由器都可以,用QOS就可以实现了 - 14 -3层的限速就是用 qos,2层如何来做? - 16 -Cisco Catalyst 2960系列智能以太网交换机 -17 -引言:可限速的交换机一般都在三层或者以上的交换机,自2008年之后新出的交换机型号二层设备就可以做到QOS限速,精确度达到1Mbps,例如Cisco 2960系列交换机。在这之后的大 多数国内的标准二层交换机都可以做多限速

3、,精确度基本能达到1Mbps,比如中兴的标准二层,H3C的标准二层都可以做到。老式的 CISCO标准二层交换机例如2950类的交换也可以 做到限速,但是精确度只能达到 10Mbps。2950G的交换和2950为EI型 的交换没有太大的 限速区别,因为限速和IOS有关系,2950系列的交换IOS版本一般都是在9.0左右,最新的 2960系列交换机IOS版本在12.2左右,高版本的IOS提供了更强的系统功能。下面针对一些限速的方法进行总结:第一类:CISCO 3550三层交换机上的标准限速配置方法一、结构说明PC1 接在 Cisco3550 F0/1 上,速率为 1M;PC1 接在 Cisco35

4、50 F0/2上,速率为 2M;Cisco3550 的 G0/1 为出口。PC是直接接在三层交换机端口的,意思就是说限制的是三层交换机端口的上下行流量控制, 同理,如果三层交换机端口不是接PC,而是一个二层交换机,那么可以对下层的设备进行上联限速。二、详细配置过程注:每个接口每个方向只支持一个策略;一个策略可以用于多个接口。因此所有 PC的下载 速率的限制都应该定义。在同一个策略(在本例子当中为policy-map user-down),而PC不同速 率的区分是在Class-map分别定义。1、在交换机上启动QOSSwitch(config)#mls qos 在交换机上启动 QOS2、分别定义

5、PC1()和PC2(访问控制列表Switch(config)#access-list 10 permit 55 控制 pc1 上行流量Switch(config)#access-list 100 permit any 55 控制 pc1 下行流量Switch(config)#access-list 11 permit 55 控制 pc2 上行流量Switch(config)#access-list 111 permit any 0.0.0

6、.255 控制 pc2 下行流量3、定义类,并和上面定义的访问控制列表绑定Switch(config)# class-map user1-up 定义 PC1 上行的类,并绑定访问列表 10Switch(c on fig-cmap)# match access-group 10Switch(c on fig-cmap)# exitSwitch(c on fig)# class-map user2-upSwitch(config-cmap)# match access-group 11 定义 PC2 上行的类,并绑定访问列表 10Switch(c on fig-cmap)# exitSwitch(

7、c on fig)# class-map user1-dow nSwitch(config-cmap)# match access-group 100 定义 PC1 下行的类,并绑定访问列表 100Switch(con fig-cmap)# exitSwitch(con fig)# class-map user2-dow nSwitch(config-cmap)# match access-group 111 定义 PC2 下行的类,并绑定访问列表 111Switch(con fig-cmap)# exit4、定义策略,把上面定义的类绑定到该策略Switch(config)# policy-m

8、ap user1-up 定义 PC1 上行的速率为 1MSwitch(con fig-pmap)# class user1-upSwitch(con fig-pmap-c)# trust dscpSwitch(co nfig-pm ap-c)# police 1024000 1024000 exceed-action dropSwitch(c on fig)# policy-map user2-up 定义 PC2 上行的速率为 2MSwitch(c on fig-pmap)# class user2-upSwitch(c on fig-pmap-c)# trust dscpSwitch(co

9、nfig-pm ap-c)# police 2048000 1024000 exceed-action dropSwitch(config)# policy-map user-down 定义 PC1 下行的速率为 1MSwitch(c on fig-pmap)# class user1-dow nSwitch(c on fig-pmap-c)# trust dscpSwitch(co nfig-pm ap-c)# police 1024000 1024000 exceed-action dropSwitch(c on fig-pmap-c)# exitSwitch(config-pmap)#

10、class user2-down /定义 PC2 下行的速率为 2MSwitch(c on fig-pmap-c)# trust dscpSwitch(co nfig-pm ap-c)# police 2048000 1024000 exceed-action dropSwitch(c on fig-pmap-c)# exit5、在接口上运用策略Switch(c on fig)# in terface f0/1 /进入PC1端口上联交换机端口配置模式Switch(co nfig-if)# service-policy in put user1-up / 绑定 PC1 上行策略为 user1-u

11、pSwitch(co nfig)# in terface f0/2 /进入PC2端口上联交换机端口配置模式Switch(config-if)# service-policy input user2-up /绑定 PC2 上行策略为 user2-upSwitch(co nfig)# in terface g0/1 /进入交换机上联千兆端口配置模式Switch(c on fig-if)# service-policy in put user-dow n / 绑定交换机上联端口策略为user-dow n 第二类:CISCO 3550三层交换机上更简单的限速方法利用三层交换中的strom-contro

12、l (风暴控制)功能,该功能是基于端口控制单播多播 组播,可以精确到0.01%,但是一个近似值。此方法是一个门限方式,限制监控时间为每秒,超过设 置的门限便丢弃包,并且用户是不知情的,以为是网络终端,或者远程无响应,显然这种方 式不能确保终端用户每时每刻的网络畅通,所以本人认为此方法只适用于某些场合,或者和 其它策略配合使用。具体配置方法:Switch(co nfig)# in terface fO/1 / 进入交换机端口配置模式Switch(config-if)# strom-control unicast/broadcast/multi level 10 /该 port 带宽的 10%配置

13、风暴控制(storm control)详谈理解风暴控制风暴控制防止交换机的端口被局域网中的广播、多播或者一个物理端口上的单播风暴所破坏。局域网风暴发生在包在局域网中泛洪,建立的过多的流量并丧失了网络性能。协议栈中的错误或者网络配置上的错误可以导致风暴。风暴控制(或者叫流量压制)管理进栈的流量状态, 通过一段时间和对比测量带有预先设定的 压制级别门限值的方法来管理。门限值表现为该端口总的可用带宽的百分比。交换机支持单独的风暴控制门限给广播、组播和单播。如果流量类型的门限值达到了,更多这种类型的流量就会受到压制,直到进栈流量下降到门限值级别以下。注意:当组播的速度超出一组门限,所有的进站流量(广播

14、组播单播)都会被丢弃,直到级别下降到门限级别以下。只有stp的包会被转发。当广播和单播门限超出的时候,只有超出门限的流量会被封闭。当风暴控制开启了时, 交换机监视通过接口的包来交换总线和决定这个包是单播,组播还是广播。交换机监视广播组播和单播的数目,每1秒钟一次,并且当某种类型流量的门限值到达了,这种流量就会被丢弃了。这个门限以可被广播使用的总的可用带宽的百分比被指定。以下是一个接口上的一段时间内的广播流量的模型曲线图。-18 -Furwarcted 訂dfc甘辺心5这个例子也可被组播和单播流量套用。在这个例子中,广播流量在T1-T2、T4-T5时间之间被转发超过配置门限值所有的该种流量都在下

15、一个时间被丢弃。因此广播流量在T2和T5时间内是被封闭的。在下一个时断,T3,如果广播流量没有超出限制,那么它又被转发了。风暴控制算法的工作是风暴控制抑制级别和每秒钟间隔控制的结合。一个更高的门限允许更多的包通过。如果把门限值设置成100%意味着将不会限制所有任何的流量。0%意味着所有的广播组播和单播流量都会被封闭。注意:因为包不会在统一时间间隔内到达,每秒钟间隔间如果没有流量会影响风暴控制。交换机持续监视端口的流量,而且当利用级别降到门限以下,这种被丢弃类型的流量,又会被再次转发。你可以使用storm-co ntrol接口命令来设定门限值给每一种类型的流量。默认的风暴控制配置:默认地,单播组

16、播广播的风暴控制都是在交换机上关闭的,意味着: 压制级别都是100%。开启风暴控制:你在接口开启风暴控制, 并输入总可用带宽的百分比来确定你要使用给该种 流量;输入100%会允许所有流量。然而,因为硬件的限制以及包大小的不同的会导致偏差, 门限值百分比是一个近似值。注意:风暴控制仅支持在物理端口下使用;它不支持以太通道下使用,尽管能敲进去。以下例子在f0/17下把组播风暴级别限制在 70.5%Switch# con figure termi nalSwitch(con fig)# in terface fastethernet0/17限制组播类型的包Switch(c on fig-if)# s

17、torm-c on trol multicast level 70.5 /Switch(c on fig-if)# endSwitch# show storm-control fastethernetO/17 multicastIn terface Filter State LevelCurre ntFa0/17Forwardi ng70.50%0.00%这个是关闭风暴控制Switch# con figure termi nalSwitch(c on fig)# in terface fastethernet0/17Switch(c on fig-if)# no storm-c on trol

18、 multicast levelSwitch(c on fig-if)# endSwitch# show storm-c on trol fastethernet0/17 multicastIn terface Filter State LevelCurre nt第三类:CISCO 3550三层交换机具体配置方法CISCO 3550-QOS 的-接口限速Building configuration.Current configuration : 3123 bytesversio n 12.1no service padservice timestamps debug uptimeservice

19、 timestamps log datetime localtimeno service password-e ncrypti onhost name sha ngwuen able secret 5 $1$PmhU$dlsphRGumA1simUEIA87jOen able passwordip sub net-zeromls qosclass-map match-all user1-upmatch access-group 10class-map match-all user1-dow nmatch access-group 100policy-map user1-upclass user

20、1-uppolice 800000 800000 exceed-action droptrust dscpspa nnin g-tree exte nd system-idin terface FastEther netO/1no ip addressduplex fullspeed 100in terface FastEther netO/2no ip addressduplex fullspeed 100in terface FastEther net0/3no ip addressduplex fullspeed 100in terface FastEther net0/4no ip a

21、ddressduplex fullspeed 100in terface FastEther net0/5 no ip addressduplex full speed 100in terface FastEther netO/6 no ip address duplex fullspeed 100in terface FastEther net0/7 no ip address duplex fullspeed 100in terface FastEther net0/8 no ip address duplex fullspeed 100in terface FastEther net0/

22、9 no ip address duplex fullspeed 100in terface FastEthernet0/10 no ip address duplex fullspeed 100in terface FastEthernet0/11 no ip address duplex fullspeed 100in terface FastEthernet0/12 no ip address duplex fullspeed 100in terface FastEthernet0/13 no ip address service-policy in put user1-up in te

23、rface FastEthernetO/14 no ip address duplex fullspeed 100service-policy in put user1-up in terface FastEther net0/15 no ip address duplex fullspeed 100service-policy in put user1-up in terface FastEthernet0/16 no ip address duplex fullspeed 100service-policy in put user1-up in terface FastEther net0

24、/17 no ip address duplex fullspeed 100service-policy in put user1-up in terface FastEthernet0/18 no ip address duplex fullspeed 100 service-policy in put user1-up in terface FastEthernet0/19 no ip addressduplex full speed 100 service-policy in put user1-up in terface FastEthernet0/20 no ip address d

25、uplex fullspeed 100service-policy in put user1-up in terface FastEthernet0/21 no ip address duplex fullservice-policy in put user1-up in terface FastEthernet0/22 no ip address duplex fullspeed 100service-policy in put user1-up in terface FastEthernet0/23 no ip address duplex fullspeed 100service-pol

26、icy in put user1-up in terface FastEthernet0/24 descripti on wan in terface switchport mode access no ip address duplex full speed 100in terface GigabitEthernet0/1 no ip addressin terface GigabitEther net0/2 no ip addressin terface Via n1 ip address *ip default-gateway *ip classlessip h

27、ttp serverlogg ing trap debugg inglogg ing source-i nterface FastEthernet0/24loggi ng *access-list 10 permit *.0 55access-list 100 permit ip any *.0 55line con 0exec-timeout 0 0line vty 0 4passwordlogi nline vty 5 15password logi nend第四类:关于二层交换机 CISCO2960上的限速配置方法1、2960交换机所需要进行的配置项目交换机的

28、主机名、进入enable模式的密码、远程登陆的用户名和密码及设置、管理vlan的IP地址、交换机的默认网关、交换机的端口、SNMP服务、交换机时间设置等。这些和之前的2950交换机都是一样的,2960交换机和2950相比增加了限速等功能,由于今后客户新上架除了签署了流量合同的其他都要在交换机的端口上做限速。2、2960交换机配置时的注意事项首先也是十分重要的一点就是,在交换机的配置没有完成前,特别是VTP模式的配置(一般情况下VTP的初始模式因配置为 tran spare nt模式)没有完成前禁止将交换机接入网 络,以免使网络中的 VLAN信息发生改变,因当使用con sole线对其进行配置。

29、在刚开始配置2950的时候由于还没有设置密码,处于安全方面的考虑不要将其接入网 络,因使用con sole 口对其进行配置。交换机刚加电启动时所有的端口会进行自检,开始时 每个端口上的指示灯会呈琥珀色经过一段时间后熄灭。系统的指示等默认情况下会亮在SYST和STAT两个灯上。3、2960交换机的配置流程交换机启动后使用 co nsole线对其进行设置。Con sole线使用的是串行接口,串行口与 电脑的串行口相连(如电脑没有串行口可以使用转接器连接),RJ-45的接头和交换机的con sole 口相连。线连好后在 win dows上点击 开始宀程序宀附件宀通讯宀超级终端,在跳出新建连接对话框后

30、在名称一栏中填入想要新建的连接名称,然后确定。接着所连接的COM口,在COM1属性里波特率选择“ 9600”,数据位选择“ 8”,奇偶效验选择“无”,停止位 选择“ 1”,流量控制选择“无”;或直接点击“还原默认值”,确定进入2950配置界面。2950如第一次启动会出现对话配置模式选项,选择yes进入对话配置模式,选择no进入CLI命令行界面。以下配置都在CLI模式下进行。在CLI模式下交换机显示:switch在此输入命令switchswitche nableswitch# con figure termi nal switch(c on fig)#用户模式进入特权模式 进入配置模式 配置模式

31、设置主机名switch(con fig)#host name 主机名设置enable密码switch(config)#enable secret 密码一般情况下主机名的设置 规则是switch后面跟交换 机编号,如 switch20、 switch21 等设置密码时使用 secret命 令,因为它比 password命 令有更好的安全性,密码 用 Password Age nt 软件随 机生成12位包含数字和 大小写字母的密码设置远程登陆的switch(c on fig)# user name 用户名 privilege 权限 secret 密码用户名、权限和密码在设置权限参数时一般填0(最低

32、权限),用户名统一为netmaster,密码用 Password Age nt 软件 随机生成12位包含数字和大小写字母的密码对所设置的密码设置管理vlan和默认网关switch(c on fig)# service password-e ncryptio n switch(c on fig)# in terface vlan1 switch(config-if)# ip address IP 地址 子网掩码进行加密进入管理vlan的配置设置管理vlan的IP,远程登陆使用此IPswitch(c on fig-if)# no shutdow nswitch(c on fig-if)#exits

33、witch(config)# ip default-gateway IP 地址启用管理vlan退出管理vlan的配置设置默认网关设置交换机端口switch(co nfig)# in terface FastEthernet 0/1switch(config-if)# description uplink portswitch(c on fig-if)# switchport mode trunk进入交换机的1号端口 对端口进行描述,默认 时交换机1号口为上连 口将上连口设为trunk模式设置端口速率端口设为全双工模式设置SNMP服务关闭http服务设置vtyswitch(c on fig-if

34、) in terface range fastEthernet 0/2 -24进入端口 2至端口 24的 配置关闭这些端口,到使用时 再打开字符串 LgB96G0o RO命令允许读访问到任何 提交 community string 为字符串的软件,字符 串设置要符合长度8位以上、需包含大小写字母 和数字由于开启http服务在全 全上存在隐患,因关闭 设置telnet为0至4共5 条线路使系统在远程登录时使 用本地设置的用户名和 密码进行验证switch(con fig-if-ra nge)#shutdow nswitch(c on fig)#s nmp-server com munityswi

35、tch(con fig)# no ip http serverswitch(c on fig)#li ne vty 0 4switch24(config-line)# login local设置timestamps设置VTP模式switch(c on fig)# service timestamps debug datetimeswitch(c on fig)# service timestamps log datetime 默认时 debug/log 为 uptime,改为 datetime 进入VTP的设置switch#vla n databaseswitch(co nfig-if)# s

36、peed 100 switch(c on fig-if)# duplex full设置交换机时间保存交换机的设置 查看交换机设置将VTP模式设置为tran spare nt模式查看交换机的配置switch (vla n)#vtp tran spare nt switch#clock set hh:mm:ssswitch#copy runnin g-c onfig startup-c onfig switch#show runnin g-c onfig端口流量的限制交换机端口流量的限制是用policy-map来实现的。switch (config)#ip access-list standard

37、 name 建立标准的命名访问控制列表,name 为 ACL的名称Switch (config-std-nacl)# permit any / 匹配任何 ipSwitch (config)#class-map name/ 设置 QoS Class MapSwitch (config-cmap)#match access-group name name/ 绑定 ACL 歹U表Switch (con fig)#policy-map n ame/ 设置策略名称Switch (config-pmap)#class name/ 绑定 class-mapSwitch (config-pmap-c)#pol

38、ice 3000000 100000 exceed-action drop定义策略正常速率为每秒3Mbit,允 许超出的范围是100KByte,超出范 围的数据包就dropSwitch (config)#interface range fastEthernet 0/1-24 / 进入 1 24端口,默认交换机除了上联口外都要做限速Switch (con fig-if)#service-policy in putn ame / 在端口上进的方向绑定策略Switch (config) #mls qos /启用 mis qos 使策略生效端口绑定MAC地址进入配置模式后用以下命令绑定:Switch(

39、config-if )switchport port-security mac-address MAC( 主机的 MAC 地址)解除绑定Switch(config-if )no switchport port-security mac-address MAC( 主机的 MAC 地址)第五类:关于其它二层交换机上的限速配置方法cisco 2950二层交换机如何限速?使用cisco 2950交换机,每个端口都是二层接入,如何限速?使用service-policy可以进行端口限速:可以先定义class,然后Switch(c on fig)# policy-map policy1Switch(c on

40、 fig-pmap)# class class1Switch(co nfig-pm ap-c)# police 1000000 65536 exceed-action drop然后在接口下配置:Switch(c on fig)# in terface gigabitethern etO/17Switch(c on fig-if)# service-policy in put plcmap1可以限速,但是不精确。三层和路由器都可以,用 QOS就可以实现了给个6500上的限速例子:Mls qos aggregate-policer test 50000000 100000 con form-act

41、 ion tran smit exceed-act ion dropMls qosclass-map match-a ny test_limitematch access-group n ame test_addrpolicy-map rate-limit-upli nkclass test_limitepolice aggregate testip access-list exte nded test_addrpermit ip any x.x.x.x 55in ter g0/1service-policy in put rate-limit-upli nk总结:Cisco交换

42、机端口限速常用配置,以前端口限速的工作都是由上级部门来做,最近由于分公司自己的内部客户需求,我们要为其提供50M的带宽.为此我们可是煞费苦心作了两天的 测试,先来说说我们测试的设备连接情况:思科3560端口 0/47 (模拟用户)思科 6509端口 0/1、0/2 (模拟局端,两条路有上联,热备)。测试方法在3560及6509上分别起ftp进行测速重点来了,来说说6509上的命令吧:mls qos aggregate-policer test 50000000 100000 con form-acti on tran smit exceed-acti on drop mls qosclass-

43、map match-a ny test_limitematch access-group n ame test_addrpolicy-map rate-limit-upli nkclass test_limitepolice aggregate testip access-list exte nded test_addr因为上下行都引用策略一样因此不单独做acl)permit ip any x.x.x.x (分配给用户的互联网地址段 A)permit ip x.x.x.x anypermit ip any x.x.x.x (分配给用户的互联网地址

44、段 B)permit ip x.x.x.x anyin ter f0/1ip addre x.x.x.x 52service-policy in put test_upli nk 限制上传in terf0/2ip addre x.x.x.x 52service-policy in put test_upli nk 限制上传in ter g0/47service-policy in put rate-limit-upli nk 限制下载经过测试,这个方案成功了!有几点需要解释一下,因为35和65只有在in put方向才能引用策略

45、,所以同时对上行和下载作限速需要在上联和下载两方向的端口上做,其次,我们 中间有很多弯路,说来给大家提个醒,开始我们用的测试设备性能很低,所以始终测试不出 理想的结果,很泄气,无意中拿了最好的一台电脑去测试,结果居然出人意料,后来又找了 一台高性能设备进行测试,结果非常理想,在此提醒大家,低性能的设备在测试高带宽的时 候要特别注意。3层的限速就是用qos, 2层如何来做? 华为的2层交换机,是直接进端口后,用line-rate对上下行进行限速,不过好像是要双向做 下面是偶看到的你试试看access-list 2 permit anymls qosclass-map match-all in p

46、ut-classmatch access-group 2 class-map match-all output-class match ip dscp 0policy-map output-policy-2Mclass output-classpolice 2000000 200000 exceed-action droppolicy-map in put-policy-2M class in put-classpolice 2000000 200000 exceed-action drop policy-map output-policy-5Mclass output-class polic

47、e 5000000 500000 exceed-action drop policy-map in put-policy-5Mclass in put-classpolice 5000000 500000 exceed-action droppolicy-map output-policy-10Mclass output-classpolice 10000000 1000000 exceed-action droppolicy-map in put-policy-10Mclass in put-classpolice 10000000 1000000 exceed-action droppolicy-map output-policy-20Mclass output-classpolice 20000000 1000000 exceed-action droppolicy-map in put-policy-20Mclass in put-classpolice 20000000 1000000 exceed-action dropin terface FastEther net ?/?service-policy in put

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论