如何实现STP成环保护

2025-11-06 11:48:30

1、生成树算法流程分析:

首先,手动配置了sw1的优先级(网桥ID)即bridge ID(BID)为0,sw2为4096,sw3为缺省值32768。由此可确定sw1为根网桥。

其次,选取指定端口。每一个网段都有一个指定端口。根网桥的所有端口都是指定端口,可见sw1的3个端口全部是指定端口,还剩下sw2到sw3的网段没有选取指定端口。指定端口的选取原则为

cost小的

当前端口所在网桥的bridge ID小的

直连网桥的端口ID(如128.3)

比较第一个值,发现都一样,为19;比较第二个值,显然sw2的f0/3所在网桥的BID小,确定f0/3为指定端口

然后,选取根端口。每一个非根网桥都有一个根端口。根端口的选取原则为

cost值小的

对端(直连)网桥的bridge ID小的

直连网桥的端口ID

比较下来,可以确定sw3的f0/1为根端口。

如何实现STP成环保护

2、路由器模拟2台PC

如何实现STP成环保护

如何实现STP成环保护

3、sw1的配置(sw2、sw3配置基本类似)

w1#vla

sw1#vlan dat

sw1#vlan database 

sw1(vlan)#vlan 8

VLAN 8 added:

    Name: VLAN0008

sw1(vlan)#vlan 10

VLAN 10 added:

    Name: VLAN0010

sw1(vlan)#vlan 11

VLAN 11 added:

    Name: VLAN0011

sw1(vlan)#show vla

sw1(vlan)#exi     

sw1(vlan)#exit 

APPLY completed.

Exiting....

如何实现STP成环保护

4、stp根网桥配置

如何实现STP成环保护

5、stp备份根网桥配置

如何实现STP成环保护

6、核心交换机sw1和sw2捆绑

sw2#show etherchannel summary   //查看以太网通道信息

Flags:  D - down        P - in port-channel

        I - stand-alone s - suspended

        R - Layer3      S - Layer2

        U - in use

Group Port-channel  Ports

-----+------------+-----------------------------------------------------------

2     Po2(SU)     Fa0/1(P)   Fa0/2(P)   

sw2#

如何实现STP成环保护

7、sw3的ACCESS接口配置

sw3#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

sw3(config)#int f0/10

sw3(config-if)#sw mo ac 

sw3(config-if)#sw ac vlan 10

sw3(config-if)#no sh

sw3(config-if)#exi

sw3(config)#int f0/11

sw3(config-if)#sw mo ac

sw3(config-if)#sw ac vlan 11

sw3(config-if)#no sh

sw3(config-if)#exi

sw3(config)#

8、stp调测

如何实现STP成环保护

9、三层网络接口配置

sw1# 

sw1#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

sw1(config)#ip routin

sw1(config)#int vlan 10

sw1(config-if)#ip 

*Mar  1 00:54:01.355: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up

sw1(config-if)#ip address 192.168.10.1 255.255.255.0

sw1(config-if)#no sh

sw1(config-if)#exi

sw1(config)#int vlan 11

sw1(config-if)#i

*Mar  1 00:54:31.103: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan11, changed state to up

sw1(config-if)#ip address

sw1(config-if)#ip address 192.168.11.1 255.255.255.0

sw1(config-if)#no sh

sw1(config-if)#exi

sw1(config)#

测试连通性

pc1#ping 192.168.11.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.11.1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 8/224/1012 ms

pc1#ping 192.168.11.100

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.11.100, timeout is 2 seconds:

..!!!

Success rate is 60 percent (3/5), round-trip min/avg/max = 16/24/32 ms

pc1#

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢