一、实验名称:STP 选路案例
二、实验需求:
PC1和PC6属于VLAN16,网段为 192.168.16.0/24
PC2和PC5属于VLAN25,网段为 192.168.25.0/24
PC3和PC4属于VLAN34,网段为 192.168.34.0/24
确保同网段的设备之间,通信路径都是最优的
判断出设备角色、端口角色、端口状态
三、实验拓扑
四、实验思路
配置思路:
1,搭建拓扑,配置基本PCI的P地址
2,配置交换机
--创建VLAN 16 、25、34
--配置与终端相连接口类型
--配置与交换机相连接口类型
--配置MSTP
--配置实例的根网桥
3,验证测试
五、实验步骤 (以交换机D 为例)
第一步:配置基本PCI的P地址
<Huawei>sy //进入系统视图
[Huawei]sy D //给设备改名
第二步:所有交换机创建VLAN
[D]vlan batch 16 25 34 //批量创建VLAN
[D]dis vlan //验证VLAN的创建
第三步:配置链路类型
[D]int g0/0/1 //进入接口
[D-GigabitEthernet0/0/1]port link-type access //配置接口类型为access
[D-GigabitEthernet0/0/1]port default vlan 25 //将接口加入VLAN25
[D-GigabitEthernet0/0/1]int g0/0/2
[D-GigabitEthernet0/0/2]p l a
[D-GigabitEthernet0/0/2]p d v 16
[D-GigabitEthernet0/0/2]q
[D]port-group group-member g0/0/3 to g0/0/5 //将多个接口加入临时端口组
[D-port-group]port link-type trunk //配置接口类型为trunk
[D-port-group]port trunk allow-pass vlan all //允许所有VLAN通过
[D-port-group]q
[D]dis port vlan //查看端口下VLAN信息 : 接口的链路类型、PVID 等信息
第四步:配置MSTP
[D]stp region-configuration
[D-mst-region] region-name cw
[D-mst-region] instance 16 vlan 16
[D-mst-region] instance 25 vlan 25
[D-mst-region] instance 34 vlan 34
[D-mst-region] active region-configuration
[D-mst-region]q
[D]dis stp region-configuration
第五步:实现实例16的需求
[D]stp instance 16 priority 4096
[D]dis stp instance 16 brief
第六步:验证 :
将验证截图提出 ,进行描述
五、实验总结
实验中涉及到的知识点 有:VLAN 交换机工作原理、链路类型access 、trunk 、生成树协议MSTP 、选路规则 等 ,通过这个实验 。。。。。。。,过程 中。。。。。。掌握了。。。。。
======================
配置文档:
<A>DIS current-configuration
#
sysname A
#
vlan batch 16 25 34
#
stp region-configuration
region-name cw
instance 16 vlan 16
instance 25 vlan 25
instance 34 vlan 34
active region-configuration
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 16
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/4
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
=====================
<B>DIS CU
#
sysname B
#
vlan batch 16 25 34
#
stp instance 34 priority 4096
#
stp region-configuration
region-name cw
instance 16 vlan 16
instance 25 vlan 25
instance 34 vlan 34
active region-configuration
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 34
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/4
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
===========
[C]DIS CU
#
sysname C
#
vlan batch 16 25 34
#
stp instance 25 priority 4096
#
stp region-configuration
region-name cw
instance 16 vlan 16
instance 25 vlan 25
instance 34 vlan 34
active region-configuration
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 25
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 34
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/4
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/5
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
port-group 1
group-member GigabitEthernet0/0/3
group-member GigabitEthernet0/0/4
group-member GigabitEthernet0/0/5
#
=====================
<D>DIS CU
#
sysname D
#
vlan batch 16 25 34
#
stp instance 16 priority 4096
#
stp region-configuration
region-name cw
instance 16 vlan 16
instance 25 vlan 25
instance 34 vlan 34
active region-configuration
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 25
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 16
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/4
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/5
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
更多资源------>黑凤梨 (zhangwujistudy) - Gitee.com