华为交换机:MSTP的基础配置

华为交换机:MSTP的基础配置_第1张图片

现状分析

某公司的总部包含4个部门,为了增加网络的可靠性,需要所在的交换机上配置MSTP,确保网络不会出现环路问题,同时实现负载均衡。

网络设计

  • 搭建网络拓扑,配置VLAN,Trunk,链路聚合。
  • 在4台交换机上配置MSTP,在交换机SW1创建两个实例,将vlan10,vlan20划分到实例1中,将vlan30,vlan40划分到实列2中。
  • 通过配置MSTP,使实实例1和2的MSTI具有不同的根桥。SW1是实例1的根桥(优先级为4096),是实例2的次根桥(优先级为8192);SW2是实例2的根桥(优先级为4096),是实例1的次根桥(优先级为8192)。- 对以上配置逐项进行测试,确保局域网中没有环路。

项目实施

MSTP的配置

SW1-SW4 配置STP模式为MSTP,配置MSTP域(SW1~SW4执行相同的命令)

[sw1]vlan batch 10 20 30 40   //创建VLAN
[sw1]stp mode mstp		//STP的模式改为MSTP
[sw1]stp region-configuration   //进入MST域视图
[sw1-mst-region]region-name pokes01   //MSTP域的名称pokes01
[sw1-mst-region]revision-level 1   //域的修订级别,默认MST域的修订级别为0
[sw1-mst-region]instance 1 vlan 10 20   //SMST实列和vlan映射关系
[sw1-mst-region]instance 2 vlan 30 40
[sw1-mst-region]active region-configuration   //激活MSTP域配置

纯净版便于复制

vlan batch 10 20 30 40
stp mode mstp
stp region-configuration
region-name pokes01
revision-level 1
instance 1 vlan 10 20
instance 1 vlan 30 40
active region-configuration

链路聚合

[sw1]int Eth-Trunk 1
[sw1-Eth-Trunk1]trunkport GigabitEthernet 0/0/1 to 0/0/2
[sw1-Eth-Trunk1]port link-type trunk
[sw1-Eth-Trunk1]port trunk allow-pass vlan 10 20 30 40

[sw2]int Eth-Trunk 1
[sw2-Eth-Trunk1]trunkport GigabitEthernet 0/0/1 to 0/0/2
[sw2-Eth-Trunk1]port link-type trunk
[sw2-Eth-Trunk1]port trunk allow-pass vlan 10 20 30 40

接入层和核心层的trunk配置

[sw1-GigabitEthernet0/0/3]dis th
interface GigabitEthernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 10 20

[sw1-GigabitEthernet0/0/4]dis th
interface GigabitEthernet0/0/4
 port link-type trunk
 port trunk allow-pass vlan 30 40


[sw2-GigabitEthernet0/0/3]dis th
#
interface GigabitEthernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 30 40

[sw1-GigabitEthernet0/0/3]dis th
#
interface GigabitEthernet0/0/4
 port link-type trunk
 port trunk allow-pass vlan 10 20
 

[sw3-GigabitEthernet0/0/1]dis th
#
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 10 20

[sw3-GigabitEthernet0/0/2]dis th
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 10 20

[sw4-GigabitEthernet0/0/1]dis th
#
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 30 40

[sw4-GigabitEthernet0/0/2]dis th
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 30 40

接入层的vlan配置

sw3

interface GigabitEthernet0/0/12
 port link-type access
 port default vlan 10
#
interface GigabitEthernet0/0/13
 port link-type access
 port default vlan 20

sw4

interface GigabitEthernet0/0/14
 port link-type access
 port default vlan 30
#
interface GigabitEthernet0/0/15
 port link-type access
 port default vlan 40

至此已经基本配置完毕了,接下来我们需要调试SMTP的优先级

调试SMTP的优先级

[SW1]stp instance 0 priority 4096
[sw1]stp instance 1 priority 4096
[sw1]stp instance 2 priority 8192

[sw2]stp instance 0 priority 8192
[sw2]stp instance 1 priority 8192
[sw2]stp instance 2 priority 4096

查看信息

[sw1]dis stp region-configuration 
 Oper configuration
   Format selector    :0     //格式选择器
   Region name        :pokes01    //配置名称
   Revision level     :1	//修订级别

   Instance   VLANs Mapped		//实列和VLAN映射表
      0       1 to 9, 11 to 19, 21 to 29, 31 to 39, 41 to 4094
      1       10, 20
      2       30, 40



[sw1]dis stp topology-change 
 CIST topology change information     //CIST拓扑变化信息
   Number of topology changes             :42	//从MSTP初始化开始,发送拓扑变化的总计次数
   Time since last topology change        :0 days 0h:0m:48s	//距离最近一次变化时间
   Topology change initiator(notified)    :Eth-Trunk1	//收到报文而触发的端口
   Topology change last received from     :4c1f-cce1-3e13	//拓扑变化报文来源的桥MAC地址
   Number of generated topologychange traps :   21	//产生的告警次数
   Number of suppressed topologychange traps:   2	//抑制的告警次数

 MSTI 1 topology change information
   Number of topology changes             :25
   Time since last topology change        :0 days 0h:0m:48s
   Topology change initiator(notified)    :Eth-Trunk1
   Topology change last received from     :4c1f-cce1-3e13
   Number of generated topologychange traps :   21
   Number of suppressed topologychange traps:   2

 MSTI 2 topology change information
   Number of topology changes             :2
   Time since last topology change        :0 days 0h:0m:16s
   Topology change initiator(detected)    :GigabitEthernet0/0/4
   Number of generated topologychange traps :   21
   Number of suppressed topologychange traps:   2

你可能感兴趣的:(#,网络基础,华为)