1、实验三STP实验三 :STP一:实验目标1 组网要求:此阿勇两台核心交换机组网来提高网络可靠性,为防止二层环路,需要全网运行STP:将SW1部署为根网桥,SW2部署为备份网桥,并将接入PC的接口配置为portfast端口。2 分析STP选举过程(根网桥、根端口、指定端口、阻塞端口)。二:拓扑图三:预期结果 对于vlan8和vlan10 ,SW3的FA0/2口是阻塞的,对于vlan11,SW3的FA0/1口是阻塞的。四:调试SW3上STP配置:SW1上STP配置:SW2上STP配置:五:测试SW3上show spanning-tree bri:Vlan8:Vlan 10:Vlan 11:Pc2
2、ping pc1:六:总结与原理分析Pc1 ping pc2数据流分析:1 Pc1封装icmp包,发现未知目的mac地址且目的IP与自己不在同一个网段,则封装一个arp请求,请求的目的IP为网关IP,目的mac为全F;2 在通过fa0/10口时,arp请求被打上了vlan10 的标签;3 进入sw3,sw3查询mac地址表,发现没有pc1 的mac地址,便更新mac表;4 由于配置了生成树协议,相对于vlan10,sw3的fa0/2口是阻塞的,所以arp请求被 交换机从fa0/1口发送到三层交换机sw1;5 Sw1收到arp请求后,发现目的ip是自身的,然后拆vlan10标,更新mac地址表,
3、便封装一个arp应答,封装时打上vlan10的标, 从fa0/3口单播出去;6 Sw3收到arp应答,查询mac地址表后,从fa0/10转发出去,在出口拆掉vlan10的标签;7 Pc1收到arp应答,更新自身的arp缓存表,重新封装icmp包,其目的mac是网关,目的IP是pc2的IP地址,将封装好的icmp包,通过fa0/10口送往SW3;8 Icmp包在fa0/10口被打上vlan10的标签;9 Icmp包进入sw3,sw3查询mac地址表,把icmp包从fa0/1口转发出去;10 SW1收到icmp包,拆vlan10标,发现目的IP地址不是自己的,但是网关却是已知的vlan11,且不知
4、道目的mac地址,便封装一个arp请求,并打上vlan11的标签,洪泛出去;11 由于配置了生成树协议,SW3的fa0/1口相对于vlan11是阻塞的,所以arp请求从sw1的fa0/1口发送到sw2的fa0/1口;12 Sw2收到arp请求后,更新自己的mac地址表,从fa0/3口发送出去,到sw3的fa0/2口;13 Arp请求从sw3 的fa0/2进入sw3,sw3更新自己的mac地址表,将arp请求从fa0/11口洪泛出去;14 在通过fa0/11口时,arp请求被拆掉了vlan11的标签,进入到pc2;15 Pc2收到arp请求后,更新自己的arp缓存表,打开arp请求,查看后,发出
5、arp应答;16 Arp应答在经过fa0/11口时,被打上了vlan11的标签;17 Sw3收到arp应答后,更新自身的mac地址表,再查询mac地址表,从fa0/2口转发arp应答给SW2;18 Sw2收到arp应答后,更新自身的mac地址表,再查询mac地址表,从fa0/1口转发给sw1;19 Sw1收到arp应答后,拆掉vlan11的标签,更新mac地址表,重新封装icmp包,并打上vlan11的标签,从fa0/1口转发给sw2;20 Sw2收到icmp包后,查询mac地址表,从fa0/3转发icmp包到sw3;21 Sw3收到icmp包后,查询mac地址表,从fa0/11转发icmp包
6、到pc2;22 Icmp包在经过接口fa0/11时,被拆掉vlan11的标签;23 Pc2收到icmp包后,发现目的IP是自己的,目的mac是自己的,打开icmp包,然后封装一个icmp回应包;24 Icmp回应包在链路中一直被转发其路径是:PC2SW3SW2SW1SW3PC1。七:配置show runSW1:!version 12.3service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryption!hostname SW1!boot-start-ma
7、rkerboot-end-marker!no aaa new-model!resource policy!memory-size iomem 5ip subnet-zero!ip cefno ip dhcp use vrf connected!no ip domain lookupno ftp-server write-enable!spanning-tree vlan 8 priority 0spanning-tree vlan 10 priority 0spanning-tree vlan 11 priority 4096!interface FastEthernet0/0!interfa
8、ce FastEthernet0/1 switchport mode trunk!interface FastEthernet0/2!interface FastEthernet0/3 switchport mode trunk!interface FastEthernet0/4!interface FastEthernet0/5!interface FastEthernet0/6!interface FastEthernet0/7!interface FastEthernet0/8!interface FastEthernet0/9!interface FastEthernet0/10!in
9、terface FastEthernet0/11!interface FastEthernet0/12!interface FastEthernet0/13!interface FastEthernet0/14!interface FastEthernet0/15!interface Vlan1 no ip address!interface Vlan8 ip address 192.168.8.129 255.255.255.128!interface Vlan10 ip address 192.168.10.1 255.255.255.0!interface Vlan11 ip addre
10、ss 192.168.11.1 255.255.255.0!ip http serverip classless!control-plane!line con 0 exec-timeout 0 0 logging synchronousline aux 0line vty 0 4!EndSW2:!version 12.3service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryption!hostname SW2!boot-start-markerboot
11、-end-marker!no aaa new-model!resource policy!memory-size iomem 5ip subnet-zero!ip cefno ip dhcp use vrf connected!no ip domain lookupno ftp-server write-enable!spanning-tree vlan 8 priority 4096spanning-tree vlan 10 priority 4096spanning-tree vlan 11 priority 0!interface FastEthernet0/0!interface Fa
12、stEthernet0/1 switchport mode trunk!interface FastEthernet0/2!interface FastEthernet0/3 switchport mode trunk!interface FastEthernet0/4!interface FastEthernet0/5!interface FastEthernet0/6!interface FastEthernet0/7!interface FastEthernet0/8!interface FastEthernet0/9!interface FastEthernet0/10!interfa
13、ce FastEthernet0/11!interface FastEthernet0/12!interface FastEthernet0/13!interface FastEthernet0/14!interface FastEthernet0/15!interface Vlan1 no ip address!interface Vlan8 ip address 192.168.8.130 255.255.255.128!ip default-gateway 192.168.8.129ip http serverip classless!control-plane!line con 0 e
14、xec-timeout 0 0 logging synchronousline aux 0line vty 0 4!EndSW3:!version 12.3service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryption!hostname SW3!boot-start-markerboot-end-marker!no aaa new-model!resource policy!memory-size iomem 5ip subnet-zero!ip c
15、efno ip dhcp use vrf connected!no ip domain lookupno ftp-server write-enable!interface FastEthernet0/0!interface FastEthernet0/1 switchport mode trunk!interface FastEthernet0/2 switchport mode trunk!interface FastEthernet0/3!interface FastEthernet0/4!interface FastEthernet0/5!interface FastEthernet0
16、/6!interface FastEthernet0/7!interface FastEthernet0/8!interface FastEthernet0/9!interface FastEthernet0/10 switchport access vlan 10 spanning-tree portfast!interface FastEthernet0/11 switchport access vlan 11 spanning-tree portfast!interface FastEthernet0/12!interface FastEthernet0/13!interface FastEthernet0/14!interface FastEthernet0/15!interface Vlan1 no ip address!interface Vlan8 ip address 192.168.8.132 255.255.255.128!ip default-gateway 192.168.8.129ip http serverip classless!control-plane!line con 0 exec-timeout 0 0 logging synchronousline aux 0line vty 0 4!end
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1