软考中级网络工程师--ensp 实验(二)

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
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值