vlan划分
单个交换机使用access口
同一个vlan下才能互通
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]sysname lsw1
[lsw1]vlan batch 20 40
[lsw1]int e0/0/2
[lsw1-Ethernet0/0/2]port link-type access
[lsw1-Ethernet0/0/2]port default vlan 40
[lsw1-Ethernet0/0/2]q
[lsw1]int e0/0/3
[lsw1-Ethernet0/0/3]port link-type access
[lsw1-Ethernet0/0/3]port default vlan 20
[lsw1-Ethernet0/0/3]q
[lsw1]
两台交换机配置,交换机之间用trunk 口,交换机与电脑用access口
lsw1配置
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]sysname lsw1
[lsw1]vlan batch 20 40
Info: This operation may take a few seconds. Please wait for a moment...done.
[lsw1]int e0/0/1
[lsw1-Ethernet0/0/1]port link-type trunk
[lsw1-Ethernet0/0/1]port trunk allow-pass vlan 20 40
[lsw1-Ethernet0/0/1]q
[lsw1]int e0/0/2
[lsw1-Ethernet0/0/2]port link-type access
[lsw1-Ethernet0/0/2]port default vlan 40
[lsw1-Ethernet0/0/2]q
[lsw1]int e0/0/3
[lsw1-Ethernet0/0/3]port link-type access
[lsw1-Ethernet0/0/3]port default vlan 20
[lsw1-Ethernet0/0/3]q
[lsw1]
lsw2 配置
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]sysname lsw2
[lsw2]vlan batch 20 40
Info: This operation may take a few seconds. Please wait for a moment...done.
[lsw2]int e0/0/1
[lsw2-Ethernet0/0/1]port link-type trunk
[lsw2-Ethernet0/0/1]port trunk allow-pass vlan 20 40
[lsw2-Ethernet0/0/1]q
[lsw2]int e0/0/2
[lsw2-Ethernet0/0/2]port link-type access
[lsw2-Ethernet0/0/2]port default vlan 20
[lsw2-Ethernet0/0/2]q
[lsw2]int e0/0/3
[lsw2-Ethernet0/0/3]port link-type access
[lsw2-Ethernet0/0/3]port default vlan 40
[lsw2-Ethernet0/0/3]q
STP生成树协议
S1配置
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]sysname S1
[S1]stp enable #开启stp服务
[S1]stp mode stp #设置stp模式为普通
Info: This operation may take a few seconds. Please wait for a moment...done.
[S1]
S2配置
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]sysname S2
[S2]stp enable
[S2]stp mode stp
Info: This operatio
S3配置
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]sysname S3
[S3]stp enable
[S3]stp mode stp
查看生成树的摘要信息
S1
[S1]display stp brief
MSTID Port Role STP State Protection
0 Ethernet0/0/1 DESI FORWARDING NONE
0 Ethernet0/0/2 ROOT FORWARDING NONE
[S1]
S2
[S2]display stp brief
MSTID Port Role STP State Protection
0 Ethernet0/0/1 ALTE DISCARDING NONE
0 Ethernet0/0/2 ROOT FORWARDING NONE
[S2]
S3
[S3]display stp brief
MSTID Port Role STP State Protection
0 Ethernet0/0/1 DESI FORWARDING NONE
0 Ethernet0/0/2 DESI FORWARDING NONE
[S3]
初步判断S3为根交换机,因为该交换机上的所有端口都是指定端口
配置S1为根交换机
[S1]stp priority 0
配置S2为备份交换机
[S2]stp priority 4096