HUAWEI(STP配置)

【理解尚浅,有错请指出】

2.项目规划设计

根据拓扑图1可知,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) 配置STP优先级

(5) 配置各部门计算机的IP地址

具体规划如下表:

表1 VLAN规划表

表3 IP地址规划表

3.项目实施

(1)创建VLAN

为各部门创建相应的VLAN。

  • SW1的配置

[Huawei]system-view

[Huawei]sysname SW1

[SW1]vlan 10

[SW1-vlan10]description Technical //vlan 描述信息 Technical

2)将端口划分至相应VLAN

  • SW1的配置

[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

(3)开启STP

  • SW1的配置

[SW1]stp enable 命令用来使能交换设备或端口上的STP/RSTP/MSTP功能。

[SW1]stp mode stp 配置交换设备的STP模式

(4)配置STP优先级

将SW1配置为主根交换机,SW2为备份根交换机。

方法1:SW1的优先级改为0,SW2的优先级改为4096

  • SW1的配置

[SW1]stp priority 0 priority:优先级

  • SW2的配置

[SW2]stp priority 4096

方法2:首先删除在SW1上所配置的优先级,使用stp root primary 命令配置主根交换机。

[SW1]undo stp priority

[SW1]stp root priority

删除在SW2上所配置的优先级,使用stp root secondary 命令配置备份根交换机

[SW2]undo stp priority

[SW2]stp root secondary root secondary:根次级

5)配置各部门计算机的IP地址

项目验证

(1)验证各交换机的VLAN配置信息

(2)查看各交换机的STP状态

查看各交换机STP状态信息,SW1、SW2使用display stp命令查看stp模式是否正确,SW3、SW4使用display stp brief命令查看备用端口是否处于Discarding状态。

(3)测试各部门计算机的互通性

通过Ping命令,测试各部门内部通信息的情况。

使用财务部计算机Ping本部门的计算机:

猜你喜欢

转载自blog.csdn.net/h20040928/article/details/127854680
STP