STP配置

组网说明          为网络中的三台设备配置STP协议,以保证网络中不存在环路问题。

配置步骤

        SW A的配置         #配置STP switch(config)#spanning-tree switch(config)#spanning-tree mode stp switch(config)#spanning-tree priority 4096         SW B的配置         #配置STP switch(config)#spanning-tree switch(config)#spanning-tree mode stp switch(config)#spanning-tree priority 8192         SW C的配置         #配置STP switch(config)#spanning-tree switch(config)#spanning-tree mode stp

注意事项

        1.DCN设备默认的生成树模式为MSTP

单端口环路检测功能配置

   组网说明

        针对网络中存在用户自行架设的HUB设备可能导致的环路,在交换机设备上运行单端口环路检测以防止由于HUB连线失误导致的网络环路。

    配置步骤

        #全局配置单端口环路检测报文的发送间隔(有环路时120秒发送1次,没有环路时2秒发送1次) switch(config)#loopback-detection interval-time 35 15          #端口打开单端口环路检测功能,控制模式为ShutDown switch(config)#interface ethernet 1/1-24 switch(config-if-port-range)#loopback-detection special-vlan 1 switch(config-if-port-range)#loopback-detection control shutdown switch(config-if-port-range)#exit         #全局打开单端口环路ShutDown自动恢复功能,恢复时间为300秒 switch(config)#loopback-detection control-recovery timeout 300

    注意事项

        1.单端口环路检测在必须要在端口开启。同时,必须要指定检测那个Vlan内的环路,此功能才可生效         2.单端口环路检测功能在和STP协议混合使用时,端口的控制模式只能是“ShutDown”否则会导致STP协议状态异常         3.端口控制模式是“ShutDown”时,需要全局打开恢复功能。默认ShutDown的端口不会自动恢复

 

          组网说明  

       4台设备组成的口字型拓扑中,运行MSTP协议保证网络中不存在冗余链路。其中SW 1的优先级为4096,其余设备分别为8192,12288和32768。

               配置步骤

        SW A的配置         #全局打开MSTP协议,配置优先级 switch(config)#spanning-tree switch(config)#spanning-tree mst 0 priority 4096 switch(config)#spanning-tree mst configurtaion switch(config-Mstp-Region)#name test switch(config-Mstp-Region)#exit         #配置端口属性 switch(config)#interface ethernet 1/1-2 switch(config-if-port-range)#switchport mode trunk switch(config-if-port-range)#exit         SW B的配置         #全局打开MSTP协议,配置优先级 switch(config)#spanning-tree switch(config)#spanning-tree mst 0 priority 8192 switch(config)#spanning-tree mst configurtaion switch(config-Mstp-Region)#name test switch(config-Mstp-Region)#exit         #配置端口属性 switch(config)#interface ethernet 1/1-2 switch(config-if-port-range)#switchport mode trunk switch(config-if-port-range)#exit         SW C的配置         #全局打开MSTP协议,配置优先级 switch(config)#spanning-tree switch(config)#spanning-tree mst 0 priority 12288 switch(config)#spanning-tree mst configurtaion switch(config-Mstp-Region)#name test switch(config-Mstp-Region)#exit         #配置端口属性 switch(config)#interface ethernet 1/1-2 switch(config-if-port-range)#switchport mode trunk switch(config-if-port-range)#exit         SW D的配置         #全局打开MSTP协议,配置优先级 switch(config)#spanning-tree switch(config)#spanning-tree mst configurtaion switch(config-Mstp-Region)#name test switch(config-Mstp-Region)#exit         #配置端口属性 switch(config)#interface ethernet 1/1-2 switch(config-if-port-range)#switchport mode trunk switch(config-if-port-range)#exit

            注意事项

        1.在同一个MSTP域中的设备,需要保持MSTP域的名称、Vlan配置相同

MSTP多实例配置

        组网说明

        网络中的4台交换机运行MSTP。其中SW A做为Vlan 10,20的根桥,SW B做为Vlan 30,40的根桥。

        配置步骤

        SW A的配置         #配置MSTP,并创建MSTP多实例 switch(config)#spanning-tree switch(config)#spanning-tree mst configurtaion switch(config-Mstp-Region)#name test switch(config-Mstp-Region)#instance 0 vlan 10;20 switch(config-Mstp-Region)#instance 1 vlan 30;40 switch(config-Mstp-Region)#exit switch(config)#spanning-tree mst 0 priority 4096 switch(config)#spanning-tree mst 1 priority 8192         #配置端口模式和透传的Vlan信息 略         SW B的配置         #配置MSTP,并创建MSTP多实例 switch(config)#spanning-tree switch(config)#spanning-tree mst configurtaion switch(config-Mstp-Region)#name test switch(config-Mstp-Region)#instance 0 vlan 10;20 switch(config-Mstp-Region)#instance 1 vlan 30;40 switch(config-Mstp-Region)#exit switch(config)#spanning-tree mst 0 priority 8192 switch(config)#spanning-tree mst 1 priority 4096         #配置端口模式和透传的Vlan信息 略         SW C的配置         #配置MSTP,并创建MSTP多实例 switch(config)#spanning-tree switch(config)#spanning-tree mst configurtaion switch(config-Mstp-Region)#name test switch(config-Mstp-Region)#instance 0 vlan 10;20 switch(config-Mstp-Region)#instance 1 vlan 30;40 switch(config-Mstp-Region)#exit         #配置端口模式和透传的Vlan信息 略         SW D的配置         #配置MSTP,并创建MSTP多实例 switch(config)#spanning-tree switch(config)#spanning-tree mst configurtaion switch(config-Mstp-Region)#name test switch(config-Mstp-Region)#instance 0 vlan 10;20 switch(config-Mstp-Region)#instance 1 vlan 30;40 switch(config-Mstp-Region)#exit         #配置端口模式和透传的Vlan信息 略

     注意事项

        1.同一个MSTP域中的设备,Vlan信息和MSTP配置信息(名称、实例Vlan对应关系)必须保持一致,否则MSTP无法正常运行。

BPDU Guard 配置

  组网说明

         针对网络中存在用户自行架设的HUB设备可能导致的环路,在交换机设备上运行BPDU Guard检测以防止由于HUB连线失误导致的网络环路。

  配置步骤

    #端口下开启BPDU Guard,端口收到BPDU报文down掉。

switch(config-if-ethernet1/0/10)#spanning-tree portfast bpduguard recovery 30  #30s恢复

   注意事项

1.发现端口down了,show interface ethernet1/0/10,提示ethernet1/0/10 is down by bpduguard.

精彩链接

评论可见,请评论后查看内容,谢谢!!!
 您阅读本篇文章共花了: