[项目实践]
---STP生成树
目录
一、项目环境
Jan16 公司为提高网络的可靠性,使用了两台高性能交换机作为核心交换机,接入层交 换机与核心层交换机互联,形成冗余结构,拓扑如图 1 所示,
具体要求如下:
(1)为避免交换环路问题,需配置交换机的 STP 功能,要求核心交换机有较高优先级,
SW1 为根交换机,SW2 为备用根交换机,SW1-SW3 和 SW1-SW4 为主链路;
(2)技术部使用 VLAN10,网络地址为 10.0.xy.x/24,PC1 和 PC2 分别接入到 SW3 和 SW4。
①图一
二、项目实施
未做配置会产生发关播报导致 环路!! (现实中交换机产生环路直接:暴闪)
(1)STP配置模式 | 链路放行
所有交换机同配置: Sw 1|2|3|4
[ SW ] stp mode stp (ensp中默认mstp需要手工修改为stp)
[ SW ] vlan 10
[Huawei-vlan10] description Technical (vlan 描述Technical)
### SW1|2 (开trunk 放行网段)
Interface GigabitEthernet 0/0/1
port link-type trunk
port trunk allow-pass vlan 10
interface GigabitEthernet 0/0/2
port link-type trunk
port trunk allow-pass vlan 10
#
interface GigabitEthernet 0/0/3
port link-type trunk
port trunk allow-pass vlan 10
SW3|4
# (vlan 划分)
interface Ethernet0/0/1
port link-type access
port default vlan 10
interface Ethernet0/0/2
port link-type trunk
port trunk allow-pass vlan 10
#
interface Ethernet0/0/3
port link-type trunk
port trunk allow-pass vlan 10
(2)SW1 为根交换机,SW2 为备用根交换机,SW1-SW3 和 SW1-SW4 为主链路;
stp instance 0 root primary | stp root primary #都行都是一样的意思(primary:主)
stp instance 0 root secondary | stp root secondary (secondary:备)
三、项目测试
(1)查看各交换机的STP状态(设备SW1 root, SW1接口优先)
(2) 测试技术部的联通性(PC机)
总结: STP 解决了交换机环路的问题并且
(开启了交换机主备关系primary secondary ,主备链路(网络达到了可靠性)