如何实现STP成环保护
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为根端口。
2、路由器模拟2台PC
3、sw1的配置(sw2、sw3配置基本类似)w1#vlasw1#vlan datsw1#vlan databasesw1(vlan)#vlan 8VLAN 8 added: Name: VLAN0008sw1(vlan)#vlan 10VLAN 10 added: Name: VLAN0010sw1(vlan)#vlan 11VLAN 11 added: Name: VLAN0011sw1(vlan)#show vlasw1(vlan)#exi sw1(vlan)#exitAPPLY completed.Exiting....
4、stp根网桥配置
5、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 useGroup Port-channel Ports-----+------------+-----------------------------------------------------------2 Po2(SU) Fa0/1(P) Fa0/2(P) sw2#
7、sw3的A觊皱筠桡CCESS接口配置sw3#conf tEnter configuration commands, one per line. End with CNTL/Z.sw3(config)#int f0/10sw3(config-if)#sw mo acsw3(config-if)#sw ac vlan 10sw3(config-if)#no shsw3(config-if)#exisw3(config)#int f0/11sw3(config-if)#sw mo acsw3(config-if)#sw ac vlan 11sw3(config-if)#no shsw3(config-if)#exisw3(config)#
8、stp调测
9、三层网络接口配醅呓择锗置sw1#sw1#conf tEnter configuration commands, one per line. End with CN皈其拄攥TL/Z.sw1(config)#ip routinsw1(config)#int vlan 10sw1(config-if)#ip*Mar 1 00:54:01.355: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to upsw1(config-if)#ip address 192.168.10.1 255.255.255.0sw1(config-if)#no shsw1(config-if)#exisw1(config)#int vlan 11sw1(config-if)#i*Mar 1 00:54:31.103: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan11, changed state to upsw1(config-if)#ip addresssw1(config-if)#ip address 192.168.11.1 255.255.255.0sw1(config-if)#no shsw1(config-if)#exisw1(config)#测试连通性pc1#ping 192.168.11.1Type 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 mspc1#ping 192.168.11.100Type 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 mspc1#