用Ensp来模拟MSTP,交换机指定生成树,主备交换机配置

构建实验拓扑

实验思路:在4台交换机上分别创建一个相同的MST域,然后指定不同vlan的根网桥。这里分别用SW1和SW3作为vl10与vl20的根网桥,实现负载均衡。

LWS1配置

[Huawei]stp region-configuration    //进入MST视图

[Huawei-mst-region]region-name q1        //创建一个名为q1的区域

[Huawei-mst-region]instance 1 vl 10    //将vlan10生成一个生成树

[Huawei-mst-region]instance 2 vlan 20     //将vlan20生成一个生成树

[Huawei-mst-region]active region-configuration  //活MST域配置

[Huawei-mst-region]q

设置主备交换机

[Huawei]stp instance 1 root primary

[Huawei]stp instance 2 root secondary

[Huawei]stp pathcost-standard legacy

[Huawei]stp enable

[Huawei-Ethernet0/0/2]stp root-protection

[Huawei-Ethernet0/0/2]q

创建多个vlan,并且对应接口绑定不同的链路

[Huawei]vl batch 10 20

[Huawei]int e0/0/2

[Huawei-Ethernet0/0/2]port link tr

[Huawei-Ethernet0/0/2]port tr al vl al

[Huawei-Ethernet0/0/2]int e0/0/3

[Huawei-Ethernet0/0/3]port link tr

[Huawei-Ethernet0/0/3]port tr al vl al

[Huawei-Ethernet0/0/3]q

查询stp状态

[Huawei]display stp brief

 MSTID  Port                        Role  STP State     Protection

   0    Ethernet0/0/1               DESI  FORWARDING      NONE

   0    Ethernet0/0/2               DESI  FORWARDING      ROOT

   0    Ethernet0/0/3               ROOT  FORWARDING      NONE

   1    Ethernet0/0/2               DESI  FORWARDING      ROOT

   1    Ethernet0/0/3               DESI  FORWARDING      NONE

   2    Ethernet0/0/2               DESI  FORWARDING      ROOT

   2    Ethernet0/0/3               ROOT  FORWARDING      NONE

[Huawei]int e0/0/1

[Huawei-Ethernet0/0/1]port link tr

[Huawei-Ethernet0/0/1]port tr al vl al

[Huawei-Ethernet0/0/1]q

[Huawei]q

LSW3配置

[Huawei]stp region-configuration

[Huawei-mst-region]region-name q1

[Huawei-mst-region]instance 1 vl 10

[Huawei-mst-region]instance 2 vl 20

[Huawei-mst-region]active region-configuration

[Huawei-mst-region]q  

[Huawei]stp instance 2 root primary

[Huawei]stp instance 1 root secondary

[Huawei]stp pathcost-standard legacy

[Huawei]stp enable

[Huawei]int e0/0/2

[Huawei-Ethernet0/0/2]stp root-protection

[Huawei-Ethernet0/0/2]q

[Huawei]vlan batch 10 20

[Huawei]int e0/0/3

[Huawei-Ethernet0/0/3]port link tr

[Huawei-Ethernet0/0/3]port tr al vl al

[Huawei-Ethernet0/0/3]int e0/0/2

[Huawei-Ethernet0/0/2]port link tr

[Huawei-Ethernet0/0/2]port tr al vl al

[Huawei-Ethernet0/0/2]int e0/0/1

[Huawei-Ethernet0/0/1]port link tr

[Huawei-Ethernet0/0/1]port tr al vl al

[Huawei-Ethernet0/0/1]q

Lsw2配置

[Huawei]stp region-configuration

[Huawei-mst-region]region-name q1

[Huawei-mst-region]instance 1 vl 10

[Huawei-mst-region]instance 2 vl 20

[Huawei-mst-region]active region-configuration

[Huawei-mst-region]q

[Huawei]stp pathcost-standard legacy

[Huawei]int e0/0/2

[Huawei-Ethernet0/0/2]stp instance 1 cost 20000

[Huawei-Ethernet0/0/2]q

[Huawei]stp en   

[Huawei]stp enable

[Huawei]int e0/0/3

[Huawei-Ethernet0/0/3]stp disable

[Huawei-Ethernet0/0/3]q

[Huawei]vl batch 10 20

[Huawei]int e0/0/1

[Huawei-Ethernet0/0/1]port link tr

[Huawei-Ethernet0/0/1]port tr al vl al

[Huawei-Ethernet0/0/1]int e0/0/2

[Huawei-Ethernet0/0/2]port link tr

[Huawei-Ethernet0/0/2]port tr al vl al

[Huawei-Ethernet0/0/2]int e0/0/3

[Huawei-Ethernet0/0/3]port link ac

[Huawei-Ethernet0/0/3]port de vl 10

[Huawei-Ethernet0/0/3]q

[Huawei]display stp brief

LSW4配置

[Huawei]stp region-configuration

[Huawei-mst-region]region-name q1

[Huawei-mst-region]instance 1 vl 10

[Huawei-mst-region]instance 2 vl 20

[Huawei-mst-region]active region-configuration

[Huawei-mst-region]q

[Huawei]stp pathcost-standard legacy

[Huawei]int e0/0/2

[Huawei-Ethernet0/0/2]stp instance 2 cost 20000

[Huawei-Ethernet0/0/2]q

[Huawei]stp enable

[Huawei]int e0/0/3

[Huawei-Ethernet0/0/3]stp disable

[Huawei-Ethernet0/0/3]q

[Huawei]vlan batch 10 20

[Huawei]int e0/0/1

[Huawei-Ethernet0/0/1]port link tr

[Huawei-Ethernet0/0/1]port tr al vl al

[Huawei-Ethernet0/0/1]int e0/0/2

[Huawei-Ethernet0/0/2]port link tr

[Huawei-Ethernet0/0/2]port tr al vl al

[Huawei-Ethernet0/0/2]int e0/0/3

[Huawei-Ethernet0/0/3]port link ac

[Huawei-Ethernet0/0/3]port de vl 20

[Huawei-Ethernet0/0/3]q

[Huawei]display stp brief

 MSTID  Port                        Role  STP State     Protection

   0    Ethernet0/0/1               ROOT  FORWARDING      NONE

   0    Ethernet0/0/2               DESI  FORWARDING      NONE

   1    Ethernet0/0/1               ROOT  FORWARDING      NONE

   1    Ethernet0/0/2               ALTE  DISCARDING      NONE

   2    Ethernet0/0/1               ROOT  FORWARDING      NONE

   2    Ethernet0/0/2               DESI  FORWARDING      NONE

R1配置

[Huawei]int g0/0/0.1

[Huawei-GigabitEthernet0/0/0.1]dot1q termination vid 10

[Huawei-GigabitEthernet0/0/0.1]arp broadcast enable

[Huawei-GigabitEthernet0/0/0.1]ip add 1.1.1.1 24

[Huawei-GigabitEthernet0/0/0.1]q

[Huawei]int g0/0/1.1

[Huawei-GigabitEthernet0/0/1.1]dot1q termination vid 20

[Huawei-GigabitEthernet0/0/1.1]arp broadcast enable

[Huawei-GigabitEthernet0/0/1.1]ip add 2.1.1.1 24

 

  • 3
    点赞
  • 25
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

404谜

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值