拓扑图
需求
如果把PC2的网线拔掉,再重新插回去,交换机会重新STP的收敛,会有30S——50S的转发延迟,交换机会检测接口会不会有环路,这个时候PC2是不能正常访问的
PC1——ping PC2
PC>ping 192.168.1.2 -t
Ping 192.168.1.2: 32 data bytes, Press Ctrl_C to break
From 192.168.1.2: bytes=32 seq=100 ttl=128 time=93 ms
From 192.168.1.2: bytes=32 seq=101 ttl=128 time=78 ms
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
From 192.168.1.2: bytes=32 seq=121 ttl=128 time=63 ms
From 192.168.1.2: bytes=32 seq=122 ttl=128 time=78 ms
From 192.168.1.2: bytes=32 seq=123 ttl=128 time=78 ms
From 192.168.1.2: bytes=32 seq=124 ttl=128 time=78 ms
From 192.168.1.2: bytes=32 seq=125 ttl=128 time=78 ms
--- 192.168.1.2 ping statistics ---
244 packet(s) transmitted
208 packet(s) received
14.75% packet loss
round-trip min/avg/max = 0/85/655 ms
PC>
注意:
交换机的接口由down,到转发状态大概经过30S
down——>listening——>learning——>forwarding
解决办法
把连接PC的接口配置为边缘端口
SW1——把连接PC的接口配置边缘端口
[Huawei]int g0/0/3 //进入接口
[Huawei-GigabitEthernet0/0/3]stp edged-port enable //开启边缘端口
[Huawei-GigabitEthernet0/0/3]quit //退出
SW2——把连接PC的接口配置成静默接口
[Huawei]int g0/0/3 //进入接口
[Huawei-GigabitEthernet0/0/3]stp edged-port enable //开启边缘端口
[Huawei-GigabitEthernet0/0/3]quit //退出
[Huawei]
测试
把PC2的网线拔掉,再重新插回去,看数据是否可以直接转发
PC1——ping PC2
PC>ping 192.168.1.2 -t
Ping 192.168.1.2: 32 data bytes, Press Ctrl_C to break
From 192.168.1.2: bytes=32 seq=1 ttl=128 time=63 ms
From 192.168.1.2: bytes=32 seq=2 ttl=128 time=78 ms
From 192.168.1.2: bytes=32 seq=3 ttl=128 time=78 ms
Request timeout!
Request timeout!
From 192.168.1.2: bytes=32 seq=6 ttl=128 time=78 ms
From 192.168.1.2: bytes=32 seq=7 ttl=128 time=78 ms
From 192.168.1.2: bytes=32 seq=8 ttl=128 time=78 ms
From 192.168.1.2: bytes=32 seq=9 ttl=128 time=94 ms
From 192.168.1.2: bytes=32 seq=10 ttl=128 time=78 ms
From 192.168.1.2: bytes=32 seq=11 ttl=128 time=78 ms
From 192.168.1.2: bytes=32 seq=12 ttl=128 time=78 ms
--- 192.168.1.2 ping statistics ---
13 packet(s) transmitted
10 packet(s) received
23.08% packet loss
round-trip min/avg/max = 63/78/94 ms
PC>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
交换机连接PC的接口会直接转发数据,不会再STP收敛检测环路
————————————————
版权声明:本文为CSDN博主「正在努力中的杨Sir」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/Yang__Qi/article/details/115839121
推荐本站淘宝优惠价购买喜欢的宝贝:
本文链接:https://hqyman.cn/post/2099.html 非本站原创文章欢迎转载,原创文章需保留本站地址!
休息一下~~