今天的实验是 STP 生成树协议 实验设备比较多 但是实验并不复杂 STP 协议是为了防止由于环路而产生的广播风暴和单播风暴 在企业中保障网络的正常运行往往需要对设备进行拢于备份 但是这样做就会产生环路 所以今天我们讲解通过 STP 协议来避免环路的产生。
(命令和 Cisco 的差不多 呵呵 !!!!!!!!!!!!!!)
实验过程如下:
华为实验3_第1张图片
SWA :(三层设备)
sys
Enter system view, return to user view with Ctrl+Z.
[Quidway]sysname dongli
[dongli]sysname SW1
[SW1]vlan 2
[SW1-vlan2]vlan 3
[SW1-vlan3]vlan 4
[SW1-vlan4]quit
[SW1]stp vlan 1 root primary
[SW1]stp vlan 2
[SW1]stp vlan 2 root primary
[SW1]stp vlan 3 root second
[SW1]stp vlan 4 root second
[SW1]int e0/1
[SW1-Ethernet0/1]port link-type trunk
[SW1-Ethernet0/1]port trunk permit vlan all
[SW1-Ethernet0/1]int e0/2
[SW1-Ethernet0/2]port link-type trunk
[SW1-Ethernet0/2]port trunk permit vlan all
[SW1-Ethernet0/2]int e0/3
[SW1-Ethernet0/3]port link-type trunk
[SW1-Ethernet0/3]port trunk permit vlan all
[SW1-Ethernet0/3]
 
SW2 :同上
SW3 (接入层设备)
switch>sys
Enter system view, return to user view with Ctrl+Z.
[Quidway]vlan 2
[Quidway-vlan2]vlan 3
[Quidway-vlan3]vlan 4
[Quidway-vlan4]int e0/1
[Quidway-Ethernet0/1]port link-type trunk
[Quidway-Ethernet0/1]port trunk permit vlan all
[Quidway-Ethernet0/1]int e0/2
[Quidway-Ethernet0/2]trunk
?
[Quidway-Ethernet0/2]port link-type trunk
[Quidway-Ethernet0/2]port trunk permit vlan all
[Quidway-Ethernet0/2]
 
SW4 SW5 SW3
我们来测试一下
PC1 vlan1 IP 192.168.1.1  PC2 vlan1  IP 192.168.1.2
root@PCA root]# ping 192.168.1.2
64 bytes from 192.168.1.1: icmp_seq=1 ttl=128 time=0.207 ms
64 bytes from 192.168.1.1: icmp_seq=1 ttl=128 time=0.100 ms
64 bytes from 192.168.1.1: icmp_seq=1 ttl=128 time=0.96 ms
64 bytes from 192.168.1.1: icmp_seq=1 ttl=128 time=0.96 ms
 
4packets transmitted, 4 received, 0% loss, time 2000ms
 
没问题 我们把 SW1 E0/1 断开测试一下
华为实验3_第2张图片
[root@PCA root]# ping 192.168.1.2
64 bytes from 192.168.1.1: icmp_seq=1 ttl=128 time=0.207 ms
64 bytes from 192.168.1.1: icmp_seq=1 ttl=128 time=0.100 ms
64 bytes from 192.168.1.1: icmp_seq=1 ttl=128 time=0.96 ms
64 bytes from 192.168.1.1: icmp_seq=1 ttl=128 time=0.96 ms
 
4packets transmitted, 4 received, 0% loss, time 2000ms
 
 
OK 实验成功 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
O( _ )O~ 欢迎技术交流 768865545 飘云欢迎你!!!!!!!!!!!!!!!!!!!!