1.项目背景
公司为提高网络的可靠性,使用了两台高性能交换机作为核心交换机,接入层交换机与核心层交换机互联,形成冗余结构,拓扑如图所示,具体要求如下:
(1)为避免交换环路问题,需配置交换机的 RSTP 功能,加快网络拓扑收敛。要求核心交换机有较高优先级,SW1为根交换机,SW2为备用根交换机,SW1-SW3 和SW1-SW4为主链路;
(2)技术部使用VLAN10,网络地址为10.0.1.0/24,PC1和PC2分别接入到SW3 和SW4。
2.项目规划设计
内部局域网中SW1和SW2为核心交换机,其中将SW1配置为根交换机,SW2为备用根交换机;SW3和SW4作为接入交换机,其中SW1-SW3及SW1-SW4的链路由主链路,SW2-SW4及
SW2-SW3的2条链路作为备用链路。故在STP配置中需将SW1的优先级设为最高,SW2的优
先级为次高,即SW1的优先级为0,SW2的优先级为4096。将连接终端计算机的交换机端口配置为边缘端口,以加速网络的收敛。同时,技术部的计算机划分在 VLAN10的网段内,且计算机连接在不同的交换机上,故交换机之间的链路需配置为Trunk模式。
(1)创建 VLAN
(2)将端口划分至相应 VLAN
(3)启开 STP
(4)配置 RSTP 优先级
(5)配置边缘端口
(6)配置各部门计算机的 IP 地址



3.项目实施
(1)创建 VLAN
为各部门创建相应的VLAN。
①SW1的配置
[ ]system-view
[ ]sysname SW1
[10 ]vlan
[ ]description Technical
[Huawei]system-view
[Huawei]sysname SW2
[SW2]vlan 10
[SW2-vlan10]description Technical
[ ]system-view
[ ]sysname SW3
[10 ]vlan
[ ]description Technical
[Huawei]system-view
[Huawei]sysname SW4
[SW4]vlan 10
[SW4-vlan10]description Technical
[SW1]port-group group-member Ethernet 0/0/1 to Ethernet 0/0/3
[SW1-port-group]port link-type trunk
[SW1-Ethernet0/0/1]port link-type trunk
[SW1-Ethernet0/0/2]port link-type trunk
[SW1-Ethernet0/0/3]port link-type trunk
[SW1-port-group]port trunk allow-pass vlan 10
[SW1-Ethernet0/0/1]port trunk allow-pass vlan 10
[SW1-Ethernet0/0/2]port trunk allow-pass vlan 10
[SW1-Ethernet0/0/3]port trunk allow-pass vlan 10
[SW2]port-group group-member Ethernet 0/0/1 to Ethernet 0/0/3
[SW2-port-group]port link-type trunk
[SW2-Ethernet0/0/1]port link-type trunk
[SW2-Ethernet0/0/2]port link-type trunk
[SW2-Ethernet0/0/3]port link-type trunk
[SW2-port-group]port trunk allow-pass vlan 10
[SW2-Ethernet0/0/1]port trunk allow-pass vlan 10
[SW2-Ethernet0/0/2]port trunk allow-pass vlan 10
[SW2-Ethernet0/0/3]port trunk allow-pass vlan 10
[SW3]interface Ethernet0/0/10
[SW3-Ethernet0/0/10]port link-type access
[SW3-Ethernet0/0/10]port default vlan 10
[SW3]port-group group-member Ethernet 0/0/1 to Ethernet 0/0/2
[SW3-port-group]port link-type trunk
[SW3-Ethernet0/0/1]port link-type trunk
[SW3-Ethernet0/0/2]port link-type trunk
[SW3-port-group]port trunk allow-pass vlan 10
[SW3-Ethernet0/0/1]port trunk allow-pass vlan 10
[SW3-Ethernet0/0/2]port trunk allow-pass vlan 10
[SW4]interface Ethernet0/0/10
[SW4-Ethernet0/0/10]port link-type access
[SW4-Ethernet0/0/10]port default vlan 10
[SW4]port-group group-member Ethernet 0/0/1 to Ethernet 0/0/2
[SW4-port-group]port link-type trunk
[SW4-Ethernet0/0/1]port link-type trunk
[SW4-Ethernet0/0/2]port link-type trunk
[SW4-port-group]port trunk allow-pass vlan 10
[SW4-Ethernet0/0/1]port trunk allow-pass vlan 10
[SW4-Ethernet0/0/2]port trunk allow-pass vlan 10
[SW1]stp mode rstp
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW2]stp mode rstp
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW3]stp mode rstp
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW4]stp mode rstp
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW1]stp priority 0
[SW2]stp priority 4096
方法2:首先删除在SW1上所配置的优先级,使用 stp root primary命令配置主根交换机
[SW1]undo stp priority
[SW1]stp root priority
删除在SW2上所配置的优先级,使用 stp root secondary命令配置备份根交换机
[SW1]undo stp priority
[SW1]stp root secondary
[SW3]interface Ethernet0/0/10
[SW3-Ethernet0/0/10]stp edged-port enable
[SW4]interface Ethernet0/0/10
[SW4-Ethernet0/0/10]stp edged-port enable


技术部-PC2 IP 配置图
4.项目验证
(1)验证各交换机的 VLAN 配置信息


(2)查看各交换机的 STP 状态
查看各交换机STP状态信息,SW1、SW2使用 display stp 命令查看stp模式是否正确,SW3、SW4使用display stp brief命令查看备用端口是否处于 Discarding状态。
①SW1的配置
[SW1]display stp
-------[CIST Global Info][Mode RSTP]-------
CIST Bridge :32768.4c1f-cc91-20c7
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC :32768.4c1f-cc52-2ca1 / 200000
CIST RegRoot/IRPC :32768.4c1f-cc91-20c7 / 0
……
②SW2的配置
[SW2]display stp
-------[CIST Global Info][Mode RSTP]-------
CIST Bridge :32768.4c1f-cc8a-17ba
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC :32768.4c1f-cc52-2ca1 / 200000
CIST RegRoot/IRPC :32768.4c1f-cc8a-17ba / 0
……
③SW3的配置

④SW4的配置

(3)测试各部门计算机的互通性
通过 Ping 命令,测试各部门内部通信息的情况。
使用技术部计算机 PC1 Ping 本部门的计算机 PC2:
PC>ping 10.0.1.2
Ping 10.0.1.2: 32 data bytes, Press Ctrl_C to break
From 10.0.1.2: bytes=32 seq=1 ttl=128 time=63 ms
From 10.0.1.2: bytes=32 seq=2 ttl=128 time=62 ms
From 10.0.1.2: bytes=32 seq=3 ttl=128 time=47 ms
From 10.0.1.2: bytes=32 seq=4 ttl=128 time=62 ms
From 10.0.1.2: bytes=32 seq=5 ttl=128 time=47 ms
--- 10.0.1.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 47/56/63 ms
(4)模拟根端口出现故障的过程
查看 SW3 端口角色及状态

把SW3的E0/0/1端口使用shutdown关闭,同时使用display stp brief 命令观察SW2其他端口角色及状态变化。
[SW3]interface E0/0/1
[SW3-Ethernet0/0/1]shutdown
使用display stp brief 观察SW3其他端口的角色及状态变化。

可以发现,当拓扑发生变化时,RSTP根端口快速切换机制使端口状态即从 Discarding进入Forwarding状态,缩短收敛的时间,减少了对网络通信的影响。
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/249077.html