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

下载本文档

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

文档简介

1、华为生成树协议STP分析过程与配置方法一、学习目的:1、掌握配置STP的方法2、掌握修改网桥优先级影响根选举的方法3、掌握修改端口优先级影响根端口与指定端口选举的方法4、掌握配置RSTP的方法5、掌握STP与RSTP的相互兼容问题6、掌握配置MSTP实现不同vlan负载均衡的方法7、掌握MSTP与STP的相互兼容问题8、掌握生成树中的保护方法二、重点命令1、开启stpplain view plain copy 1. stp enable   2. stp mode stp  2、查看s

2、tp状态plain view plain copy 1. dis stp  2. dis stp brief  3、指定stp主根和备根plain view plain copy 1. stp root primary   2. stp root secondary  4、手工指定根桥优先级plain view plain copy 1. stp&

3、#160;priority 4096(4096的倍数)  5、指定RPplain view plain copy 1. int g0/0/10  2.  stp port priority 16(16的倍数)  6、指定DPplain view plain copy 1. int g0/0/24  2.  stp cost 2000000 

4、0;7、开启rstpplain view plain copy 1. stp enable   2. stp mode rstp  8、配置mstpplain view plain copy 1. stp enable   2. stp mode mstp  3. stp region-configuration   4.  r

5、egion-name RG1  5.  instance 1 vlan 1 to 10  6.  instance 2 vlan 11 to 20  7.  active region-configuration   9、查看mstp实例配置plain view plain copy 1. display stp

6、60;region-configuration  10、配置mstp的多实例优先级plain view plain copy 1. stp instance 1 priority 4096  2. stp instance 2 priority 8192  11、配置指定端口保护plain view plain copy 1. 配置在根桥的DP口上  2. int g

7、0/0/1  3.  stp root-protection  12、配置边缘端口保护plain view plain copy 1. 配置在接入服务器的端口  2. int g0/0/10   3.  stp edged-port enable   13、配置环路保护plain view plain copy 1. 配置在非根桥交换机的上联口 &

8、#160;2. int g0/0/13   3.  stp loop-protection   三、实验过程1、实验拓扑2、STP配置及验证plain view plain copy 1. SW1-SW4:  2. stp enable   3. stp mode stp  查看stp状态:plain view plain copy 1. SW1-

9、SW4  2. dis stp  3. dis stp brief  由图中我可以看出整个stp情况,如下图:3、将SW1配置成主根网桥,将SW2配置成备份根网桥plain view plain copy 1. SW1:  2. SW1stp root primary   3.   4. SW2:  5. SW2stp root secondary

10、  在看下SW1和SW2的stp状态,可以看到设置成主根的priority为0,备根的priority为4096。此时4台设备的生成树如下图:4、手工指定优先级,使得SW2为主根,SW1为备根plain view plain copy 1. SW1:  2. SW1undo stp root  3. SW1stp priority 8192  4.   5. SW2:  6. SW2undo st

11、p root  7. SW2stp priority 4096  再看下SW1和SW2的STP状态。5、根端口选举控制由于上一步把SW2设置成了根桥,所以SW1和SW2互联的两个口一定有一个属于ALTE状态,如下图:可以发现9口是根端口,端口优先级默认是128,数值越小优先级越高,如果我们希望10端口变为根端口,怎么做?plain view plain copy 1. SW2:  2. SW2int g0/0/10  3. SW2-Gigabit

12、Ethernet0/0/10stp port priority 16  此时再看SW1上的stp端口状态,10端口已经变成了RP。6、指定端口选举控制先看一下SW3的int g0/0/1以及SW4的int g0/0/24的端口stp状态plain view plain copy 1. SW3dis stp int g0/0/1  plain view plain copy 1. SW4dis stp int 

13、;g0/0/24  现在需求把SW3的G0/0/1变成指定端口:plain view plain copy 1. SW4:  2. SW4int g0/0/24  3. SW4-GigabitEthernet0/0/24stp cost 2000000  再看SW3的int g0/0/1以及SW4的int g0/0/24的端口stp状态,SW3的int g0/0/1变成了指定端口7、STP的收敛速度先在SW1和SW2上分别配置一个SVI口plain

14、0;view plain copy 1. SW1:  2. SW1int vlan 1  3. SW1-Vlanif1ip add 1.1.1.1 255.255.255.0  4. SW2:  5. SW2int vlan 1  6. SW2-Vlanif1ip add 1.1.1.2 255.255.255.0  看一下SW1的stp状态,9口block

15、,10口root,此时在SW1上长pingSW2,并中断SW2的10口我记了一下时间,大概中断了30秒钟,可见stp的收敛时间非常的慢,在对中断时间有极其严格要求的生产环节中不太适合。8、RSTP配置plain view plain copy 1. SW1-SW4  2. stp mode rstp  9、验证rstp的收敛时间依然在SW1上长pingSW2,并中断SW2的10口,仅仅丢了一个包,中断在1-2秒钟左右。10、STP和RSTP兼容将SW1模式更改为stp:plain view pl

16、ain copy 1. SW1:  2. SW1stp mode stp   看一下此时SW1的stp状态,和RSTP时一致;再次关闭SW2的10口,验证此时的收敛情况,发现依然中断了30秒所以RSTP兼容STP,但是收敛方式以STP模式运行。11、MSTP配置和验证通过mstp可以实现多vlan下的负载,先创建vlan2到20,并配置trunk。plain view plain copy 1. SW1:  2. SW1vlan batch

17、60;2 to 20  3. SW1int g0/0/9  4. SW1-GigabitEthernet0/0/9port link-type trunk  5. SW1-GigabitEthernet0/0/9port trunk allow-pass vlan 1 to 20  6. SW1int g0/0/10  7. SW1-GigabitEthernet0/0/10p

18、ort link-type trunk  8. SW1-GigabitEthernet0/0/10port trunk allow-pass vlan 1 to 20  9. SW1int g0/0/13  10. SW1-GigabitEthernet0/0/13port link-type trunk  11. SW1-GigabitEthernet0/0/13port trunk 

19、allow-pass vlan 1 to 20  12. SW1int g0/0/14  13. SW1-GigabitEthernet0/0/14port link-type trunk  14. SW1-GigabitEthernet0/0/14port trunk allow-pass vlan 1 to 20  15.   16. SW2: 

20、0;17. SW2vlan batch 2 to 20  18. SW2int g0/0/9  19. SW2-GigabitEthernet0/0/9port link-type trunk  20. SW2-GigabitEthernet0/0/9port trunk allow-pass vlan 1 to 20  21. SW2int g0/0/10 

21、0;22. SW2-GigabitEthernet0/0/10port link-type trunk  23. SW2-GigabitEthernet0/0/10port trunk allow-pass vlan 1 to 20  24. SW2int g0/0/13  25. SW2-GigabitEthernet0/0/13port link-type trunk  26. SW2-GigabitE

22、thernet0/0/13port trunk allow-pass vlan 1 to 20  27. SW2int g0/0/14  28. SW2-GigabitEthernet0/0/14port link-type trunk  29. SW2-GigabitEthernet0/0/14port trunk allow-pass vlan 1 to 20  

23、30.   31. SW3:  32. SW3vlan batch 2 to 20  33. SW3int g0/0/1  34. SW3-GigabitEthernet0/0/1port link-type trunk  35. SW3-GigabitEthernet0/0/1port trunk allow-pass vlan 1 to 20  

24、;36. SW3int g0/0/13  37. SW3-GigabitEthernet0/0/13port link-type trunk  38. SW3-GigabitEthernet0/0/13port trunk allow-pass vlan 1 to 20  39. SW3int g0/0/23  40. SW3-GigabitEthernet0/0/23port link-type 

25、;trunk  41. SW3-GigabitEthernet0/0/23port trunk allow-pass vlan 1 to 2  42.   43. SW4:  44. SW4vlan batch 2 to 20  45. SW4int g0/0/1  46. SW4-GigabitEthernet0/0/1port link-type

26、0;trunk  47. SW4-GigabitEthernet0/0/1port trunk allow-pass vlan 1 to 20  48. SW4int g0/0/14  49. SW4-GigabitEthernet0/0/14port link-type trunk  50. SW4-GigabitEthernet0/0/14port trunk allow-pass vlan&

27、#160;1 to 20  51. SW4int g0/0/24  52. SW4-GigabitEthernet0/0/24port link-type trunk  53. SW4-GigabitEthernet0/0/24port trunk allow-pass vlan 1 to 2  配置mstp,定义vlan1-10属于instance 1,vlan11-20属于instance 2plain

28、 view plain copy 1. SW1:  2. SW1stp mode mstp  3. SW1stp region-configuration   4. SW1-mst-regionregion-name RG1  5. SW1-mst-regioninstance 1 vlan 1 to 10  6. SW1-mst-regioninstance

29、0;2 vlan 11 to 20  7. SW1-mst-regionactive region-configuration   8. SW2:  9. SW2stp mode mstp  10. SW2stp region-configuration   11. SW2-mst-regionregion-name RG1  12. SW2-mst-regionin

30、stance 1 vlan 1 to 10  13. SW2-mst-regioninstance 2 vlan 11 to 20  14. SW2-mst-regionactive region-configuration   15. SW3:  16. SW3stp mode mstp  17. SW3stp region-configurat

31、ion   18. SW3-mst-regionregion-name RG1  19. SW3-mst-regioninstance 1 vlan 1 to 10  20. SW3-mst-regioninstance 2 vlan 11 to 20  21. SW3-mst-regionactive region-configuration   22.

32、SW4:  23. SW4stp mode mstp  24. SW4stp region-configuration   25. SW4-mst-regionregion-name RG1  26. SW4-mst-regioninstance 1 vlan 1 to 10  27. SW4-mst-regioninstance 2 vlan 11 to&

33、#160;20  28. SW4-mst-regionactive region-configuration   查看mstp实例配置配置vlan负载plain view plain copy 1. SW1:  2. SW1stp instance 1 priority 4096  3. SW1stp instance 2 priority 8192  4. 

34、0; 5. SW2:  6. SW2stp instance 1 priority 8192  7. SW2stp instance 2 priority 4096  查看mstp实例状态信息,SW1为实例1的根桥,SW2为实例2的根桥。查看端口mstp状态根据上面截图可以看出,如果SW1和SW2为两个汇聚交换机,SW3和SW4为两台接入交换机,那么SW3上vlan1-10上的流量通过g0/0/13口到SW1,SW3上vlan11-20的流量通过

35、g0/0/23口到SW2,当然SW4也类似,这样所有vlan1-10的流量都会走到SW1,所有vlan11-20的流量都会走到SW2,这样实现了链路的负载,也实现了汇聚交换机根桥的负载,当然vrrp的active也要随着mstp多实例同步完成才能起到真正负载的作用。12、mstp和stp兼容性为了使得实验简单明了,先关掉一些不必要的端口plain view plain copy 1. SW1:  2. SW1int g0/0/10  3. SW1-GigabitEthernet0/0/10shutdown 

36、; 4. SW1int g0/0/14  5. SW1-GigabitEthernet0/0/14shutdown  6. SW2:  7. SW2int g0/0/13  8. SW2-GigabitEthernet0/0/13shutdown   将SW4stp模式更改为stp模式plain view plain copy 1. SW4undo stp region-configuration 

37、;  2. SW4stp mode stp  看一下此时sw4的stp状态,发现运行了STP的SW4和运行MSTP的SW1、SW2、SW3中的实例0共同计算CIST。再看一下SW2的stp状态,发现SW2为CIST的总根(实例0的根)现在将SW4的stp priority设置为4096plain view plain copy 1. SW4stp priority 4096  再看下SW4的stp状态,发现SW4的口都变成了DP,此时SW4变成了CIST的总根13、

38、配置指定端口保护根据上一步的操作,现在SW4已经是总根,priority为4096,但是此时如果有一台交换机是从别的地方下线的交换机,管理员尚未清除它的配置,此交换机中priority更加小,这样这台设备就会把总根抢占过去,从而造成stp收敛以及网络丢包。在这种情况下,如果根桥的端口上配置了保护策略,就会防止这种情况。plain view plain copy 1. SW4int g0/0/1  2. SW4-GigabitEthernet0/0/1stp root-protection  3. SW4i

39、nt g0/0/24      4. SW4-GigabitEthernet0/0/24stp root-protection   此时我们将SW2的stp优先级设置为0,看是否会抢占根桥plain view plain copy 1. SW2stp instance 0 priority 0  如下图,我们发现SW4依然是实例0的根14、配置边缘端口保护在正常的网络中,接入交换机的接口需要配置成边缘端口,因为接入交换机往往只会接服务器,不会收到BPDU,一旦有交换机接入了边缘接口,边缘接口就会收到BPDU,此时就会自动关闭此接口。先将SW1的G0/0/10口打开,然后配置上边缘保护,并在全局下开启bpdu保护plain view plain copy 1. SW1int g0/0/10  

温馨提示

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

评论

0/150

提交评论