华为生成树协议STP分析过程与配置方法.doc_第1页
华为生成树协议STP分析过程与配置方法.doc_第2页
华为生成树协议STP分析过程与配置方法.doc_第3页
华为生成树协议STP分析过程与配置方法.doc_第4页
华为生成树协议STP分析过程与配置方法.doc_第5页
已阅读5页,还剩39页未读 继续免费阅读

下载本文档

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

文档简介

华为生成树协议STP分析过程与配置方法一、学习目的:1、掌握配置STP的方法2、掌握修改网桥优先级影响根选举的方法3、掌握修改端口优先级影响根端口与指定端口选举的方法4、掌握配置RSTP的方法5、掌握STP与RSTP的相互兼容问题6、掌握配置MSTP实现不同vlan负载均衡的方法7、掌握MSTP与STP的相互兼容问题8、掌握生成树中的保护方法二、重点命令1、开启stpplainview plaincopy1. stpenable2. stpmodestp2、查看stp状态plainview plaincopy1. disstp2. disstpbrief3、指定stp主根和备根plainview plaincopy1. stprootprimary2. stprootsecondary4、手工指定根桥优先级plainview plaincopy1. stppriority4096(4096的倍数)5、指定RPplainview plaincopy1. intg0/0/102. stpportpriority16(16的倍数)6、指定DPplainview plaincopy1. intg0/0/242. stpcost20000007、开启rstpplainview plaincopy1. stpenable2. stpmoderstp8、配置mstpplainview plaincopy1. stpenable2. stpmodemstp3. stpregion-configuration4. region-nameRG15. instance1vlan1to106. instance2vlan11to207. activeregion-configuration9、查看mstp实例配置plainview plaincopy1. displaystpregion-configuration10、配置mstp的多实例优先级plainview plaincopy1. stpinstance1priority40962. stpinstance2priority819211、配置指定端口保护plainview plaincopy1. 配置在根桥的DP口上2. intg0/0/13. stproot-protection12、配置边缘端口保护plainview plaincopy1. 配置在接入服务器的端口2. intg0/0/103. stpedged-portenable13、配置环路保护plainview plaincopy1. 配置在非根桥交换机的上联口2. intg0/0/133. stploop-protection三、实验过程1、实验拓扑2、STP配置及验证plainview plaincopy1. SW1-SW4:2. stpenable3. stpmodestp查看stp状态:plainview plaincopy1. SW1-SW42. disstp3. disstpbrief由图中我可以看出整个stp情况,如下图:3、将SW1配置成主根网桥,将SW2配置成备份根网桥plainview plaincopy1. SW1:2. SW1stprootprimary3. 4. SW2:5. SW2stprootsecondary在看下SW1和SW2的stp状态,可以看到设置成主根的priority为0,备根的priority为4096。此时4台设备的生成树如下图:4、手工指定优先级,使得SW2为主根,SW1为备根plainview plaincopy1. SW1:2. SW1undostproot3. SW1stppriority81924. 5. SW2:6. SW2undostproot7. SW2stppriority4096再看下SW1和SW2的STP状态。5、根端口选举控制由于上一步把SW2设置成了根桥,所以SW1和SW2互联的两个口一定有一个属于ALTE状态,如下图:可以发现9口是根端口,端口优先级默认是128,数值越小优先级越高,如果我们希望10端口变为根端口,怎么做?plainview plaincopy1. SW2:2. SW2intg0/0/103. SW2-GigabitEthernet0/0/10stpportpriority16此时再看SW1上的stp端口状态,10端口已经变成了RP。6、指定端口选举控制先看一下SW3的int g0/0/1以及SW4的int g0/0/24的端口stp状态plainview plaincopy1. SW3disstpintg0/0/1plainview plaincopy1. SW4disstpintg0/0/24现在需求把SW3的G0/0/1变成指定端口:plainview plaincopy1. SW4:2. SW4intg0/0/243. SW4-GigabitEthernet0/0/24stpcost2000000再看SW3的int g0/0/1以及SW4的int g0/0/24的端口stp状态,SW3的int g0/0/1变成了指定端口7、STP的收敛速度先在SW1和SW2上分别配置一个SVI口plainview plaincopy1. SW1:2. SW1intvlan13. SW1-Vlanif1ipadd1.1.1.1255.255.255.04. SW2:5. SW2intvlan16. SW2-Vlanif1ipadd1.1.1.2255.255.255.0看一下SW1的stp状态,9口block,10口root,此时在SW1上长pingSW2,并中断SW2的10口我记了一下时间,大概中断了30秒钟,可见stp的收敛时间非常的慢,在对中断时间有极其严格要求的生产环节中不太适合。8、RSTP配置plainview plaincopy1. SW1-SW42. stpmoderstp9、验证rstp的收敛时间依然在SW1上长pingSW2,并中断SW2的10口,仅仅丢了一个包,中断在1-2秒钟左右。10、STP和RSTP兼容将SW1模式更改为stp:plainview plaincopy1. SW1:2. SW1stpmodestp看一下此时SW1的stp状态,和RSTP时一致;再次关闭SW2的10口,验证此时的收敛情况,发现依然中断了30秒所以RSTP兼容STP,但是收敛方式以STP模式运行。11、MSTP配置和验证通过mstp可以实现多vlan下的负载,先创建vlan2到20,并配置trunk。plainview plaincopy1. SW1:2. SW1vlanbatch2to203. SW1intg0/0/94. SW1-GigabitEthernet0/0/9portlink-typetrunk5. SW1-GigabitEthernet0/0/9porttrunkallow-passvlan1to206. SW1intg0/0/107. SW1-GigabitEthernet0/0/10portlink-typetrunk8. SW1-GigabitEthernet0/0/10porttrunkallow-passvlan1to209. SW1intg0/0/1310. SW1-GigabitEthernet0/0/13portlink-typetrunk11. SW1-GigabitEthernet0/0/13porttrunkallow-passvlan1to2012. SW1intg0/0/1413. SW1-GigabitEthernet0/0/14portlink-typetrunk14. SW1-GigabitEthernet0/0/14porttrunkallow-passvlan1to2015. 16. SW2:17. SW2vlanbatch2to2018. SW2intg0/0/919. SW2-GigabitEthernet0/0/9portlink-typetrunk20. SW2-GigabitEthernet0/0/9porttrunkallow-passvlan1to2021. SW2intg0/0/1022. SW2-GigabitEthernet0/0/10portlink-typetrunk23. SW2-GigabitEthernet0/0/10porttrunkallow-passvlan1to2024. SW2intg0/0/1325. SW2-GigabitEthernet0/0/13portlink-typetrunk26. SW2-GigabitEthernet0/0/13porttrunkallow-passvlan1to2027. SW2intg0/0/1428. SW2-GigabitEthernet0/0/14portlink-typetrunk29. SW2-GigabitEthernet0/0/14porttrunkallow-passvlan1to2030. 31. SW3:32. SW3vlanbatch2to2033. SW3intg0/0/134. SW3-GigabitEthernet0/0/1portlink-typetrunk35. SW3-GigabitEthernet0/0/1porttrunkallow-passvlan1to2036. SW3intg0/0/1337. SW3-GigabitEthernet0/0/13portlink-typetrunk38. SW3-GigabitEthernet0/0/13porttrunkallow-passvlan1to2039. SW3intg0/0/2340. SW3-GigabitEthernet0/0/23portlink-typetrunk41. SW3-GigabitEthernet0/0/23porttrunkallow-passvlan1to242. 43. SW4:44. SW4vlanbatch2to2045. SW4intg0/0/146. SW4-GigabitEthernet0/0/1portlink-typetrunk47. SW4-GigabitEthernet0/0/1porttrunkallow-passvlan1to2048. SW4intg0/0/1449. SW4-GigabitEthernet0/0/14portlink-typetrunk50. SW4-GigabitEthernet0/0/14porttrunkallow-passvlan1to2051. SW4intg0/0/2452. SW4-GigabitEthernet0/0/24portlink-typetrunk53. SW4-GigabitEthernet0/0/24porttrunkallow-passvlan1to2配置mstp,定义vlan1-10属于instance 1,vlan11-20属于instance 2plainview plaincopy1. SW1:2. SW1stpmodemstp3. SW1stpregion-configuration4. SW1-mst-regionregion-nameRG15. SW1-mst-regioninstance1vlan1to106. SW1-mst-regioninstance2vlan11to207. SW1-mst-regionactiveregion-configuration8. SW2:9. SW2stpmodemstp10. SW2stpregion-configuration11. SW2-mst-regionregion-nameRG112. SW2-mst-regioninstance1vlan1to1013. SW2-mst-regioninstance2vlan11to2014. SW2-mst-regionactiveregion-configuration15. SW3:16. SW3stpmodemstp17. SW3stpregion-configuration18. SW3-mst-regionregion-nameRG119. SW3-mst-regioninstance1vlan1to1020. SW3-mst-regioninstance2vlan11to2021. SW3-mst-regionactiveregion-configuration22. SW4:23. SW4stpmodemstp24. SW4stpregion-configuration25. SW4-mst-regionregion-nameRG126. SW4-mst-regioninstance1vlan1to1027. SW4-mst-regioninstance2vlan11to2028. SW4-mst-regionactiveregion-configuration查看mstp实例配置配置vlan负载plainview plaincopy1. SW1:2. SW1stpinstance1priority40963. SW1stpinstance2priority81924. 5. SW2:6. SW2stpinstance1priority81927. SW2stpinstance2priority4096查看mstp实例状态信息,SW1为实例1的根桥,SW2为实例2的根桥。查看端口mstp状态根据上面截图可以看出,如果SW1和SW2为两个汇聚交换机,SW3和SW4为两台接入交换机,那么SW3上vlan1-10上的流量通过g0/0/13口到SW1,SW3上vlan11-20的流量通过g0/0/23口到SW2,当然SW4也类似,这样所有vlan1-10的流量都会走到SW1,所有vlan11-20的流量都会走到SW2,这样实现了链路的负载,也实现了汇聚交换机根桥的负载,当然vrrp的active也要随着mstp多实例同步完成才能起到真正负载的作用。12、mstp和stp兼容性为了使得实验简单明了,先关掉一些不必要的端口plainview plaincopy1. SW1:2. SW1intg0/0/103. SW1-GigabitEthernet0/0/10shutdown4. SW1intg0/0/145. SW1-GigabitEthernet0/0/14shutdown6. SW2:7. SW2intg0/0/138. SW2-GigabitEthernet0/0/13shutdown将SW4stp模式更改为stp模式plainview plaincopy1. SW4undostpregion-configuration2. SW4stpmodestp看一下此时sw4的stp状态,发现运行了STP的SW4和运行MSTP的SW1、SW2、SW3中的实例0共同计算CIST。再看一下SW2的stp状态,发现SW2为CIST的总根(实例0的根)现在将SW4的stp priority设置为4096plainview plaincopy1. SW4stppriority4096再看下SW4的stp状态,发现SW4的口都变成了DP,此时SW4变成了CIST的总根13、配置指定端口保护根据上一步的操作,现在SW4已经是总根,priority为4096,但是此时如果有一台交换机是从别的地方下线的交换机,管理员尚未清除它的配置,此交换机中priority更加小,这样这台设备就会把总根抢占过去,从而造成stp收敛以及网络丢包。在这种情况下,如果根桥的端口上配置了保护策略,就会防止这种情况。plainview plaincopy1. SW4intg0/0/12. SW4-GigabitEthernet0/0/1stproot-protection3. SW4intg0/0/244. SW4-GigabitEthernet0/0/24stproot-protection此时我们将SW2的stp优先级设置为0,看是否会抢占根桥plainview plaincopy1. SW2stpinstance0priority0如下图,我们发现SW4依然是实例0的根14、配置边缘端口保护在正常的网络中,接入交换机的接口需要配置成边缘端口,因为接入交换机往往只会接服务器,不会收到BPDU,一旦有交换机接入了边缘接口,边缘接口就会收到BPDU,此时就会自动关闭此接口。先将SW1的G0/0/10口打开,然后配置上边缘保护,并在全局下开启bpdu保护plainview plaincopy1. SW1intg0/0/102. SW1-GigabitEthernet0/0/10undoshutdown3. SW1-GigabitEthernet0/0/10stpedged-portenable4. SW1-GigabitEthernet0/0/10quit5. SW1stpbpdu-protection此时立刻收到告警,如下图,G0/0/10口被关闭了,原因是收到了bpdu packet再看下此时G0/0/10口的状态,显示是Administratively DOWN。如果此时我再次去手工up这

温馨提示

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

评论

0/150

提交评论