生成树协议-STP

一、STP概述

1、含义

STP(Spanning Tree Protocol)是生成树协议的英文缩写,可应用于计算机网络中树形拓扑结构建立,主要作用是防止网桥网络中的冗余链路形成环路工作。

2、作用

为什么要有生成树协议?
因为当有环路存在时,广播的发送会引起全网的广播风暴,因此需要打破环路生成的条件,而生成树协议就是解决二层广播风暴的重要手段,另外我们会阻塞一些端口,打破环路生成条件,当链路出现问题时,这些被阻塞的端口可以过渡到转发状态,实现链路的备份的作用

二、网桥协议单元-BPDU

1、含义

BPDU (Bridge Protocol Data Unit) 网桥协议数据单元
STP的各种选举是通过交换BPDU报文来实现的,BPDU是直接封装在以太网帧中的。(802. 3+802. 2)
对于参与STP的所有SW,它们都通过数据消息的交换来获取网络中其他SW的信息,这种消息就被称为BPDU。
BPDU是直接封装在二层的协议

2、BPDU的功能:

功能

  1. 选举根桥
  2. 确定冗余路径的位置
  3. 通过阻塞特定端口来避免环路
  4. 通告网络的拓扑变更
  5. 监控生成树的状态

BPDU每2S由根桥发送一次。(拥有最小bridge-id的交换机成为根桥)
最初的网络,每个SW都认为自己是根桥,都会发送BPDU,比较Lowest BID,选举出一个根桥,此时就只有根桥发送BPDU。非根桥只进行转发,转发时只修改bridge-id和cost字段。

3、类型

BPDU分两种类型:
1、配置BPDU通常由根网桥以周期性间隔发出,包括了STP参数,用于进行各种选举。
2、TCN (topology change notification 拓扑变更通告) BPDU这种BPDU是当交换机检测到拓扑发生变更时所产生
TCN (Topology Change Notification) BPDU
这种BPDU是SW检测到拓扑变更时产生的。可由非根网桥发出。

三、STP的选举

1、选举根交换机的规则:

lowest BID=网桥优先级+ MAC地址( 越小越优)
交换机默认网桥优先级是32768
设置成根网桥两种方法
1.修改网桥优先级命令
[SW1]stp priority 0 ( 数值需要设定为4096的倍数)
2.设置此网桥为根网桥
[SW1]stp root primary (优先级将变为0)

2、查看谁是根网桥的命令

display stp
端口角色:
RP:根端口。每个非根网桥上有且只有一个,选举到达根网桥上路径开销值最小的成为根端口。
DP:指定端口。根网桥上每个端口都是指定端口,非根网桥上需要转发数据的端口也是指定端口。
AP:预备端口。该接口状态为blocking状态,只收BPDU,不发BPDU。

3、端口状态描述:

Disabled (禁用状态):不转发数据帧,不学习MAC地址表,不参与生成树计算。
Blocking (阻塞状态) :不转发数据帧,不学习MAC地址表,接收并处理BPDU,不发送BPDU。
Listening (侦听状态) :不转发数据帧,不学习MAC地址表,参与生成树计算,接收并发送BPDU。
Learning (学习状态) :不转发数据帧,学习MAC地址表,参与生成树计算,接收并发送BPDU。
Forwarding (转发状态) :转发数据帧,学习MAC地址表,参与生成树计算,接收并发送BPDU。
端口由Blocking过渡到Forwarding有50S延时,Blocking到Listening有20S老化时间,Listening到Learning有15S过渡时间,Learning到Forwarding有15S过渡时间。

4、选举根端口、指定端口的规则

规则

  1. Lowest path cost to root. bridge (到达根的最小路径开销)
  2. lowest sender BID (最小的发送方BID)
  3. Lowest sender port ID (最小的发送方PID)端口优先级(默认128) +发送方端口号
    BW Cost
    10M 100
    100M 19
    1G 4
    10G 2

四、STP命令

1、 改网桥接口优先级命令:

stp port priority 0

2、查看端口状态命令:

display stp brief
RSTP:快速生成树协议缩短生成树端口由阻塞到转发状态的过渡时间

3、开启快速生成树方法

stp enable
stp mode. rstp
MSTP: 多实例生成树 让指定的一一个VLAN或者是多个VLAN生成一 棵树,实现链路的负载均衡

4、STP基础命令

stp mode mstp——stp模式设置为mstp
stp region-configuration——进入mstp设置模式
region-name huawei——区域名称为huawei
revision-level 1——版本级别为1
instance 1 vlan 10——定义实例1为vlan10
instance 2 vlan 20 ——定义实例2为vlan20
active region-conf iguration——对mstp配置保存
stp instance 1 root primary——定义本交换机为实例1的根
stp instance 2 root secondary ——定义本交换机为实例2的备选根
在这里插入图片描述

五、实验

1、STP小实验1

在这里插入图片描述
R1
u t m
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]q
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 192.168.10.254 24
[Huawei-GigabitEthernet0/0/0]un sh
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 192.168.20.254 24
[Huawei-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[Huawei-GigabitEthernet0/0/1]int loop 0
[Huawei-LoopBack0]ip add 1.1.1.1 32
[Huawei-LoopBack0]q

LSW1
u t m
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]q
[Huawei]vlan bat 10 20
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]p l t
[Huawei-Ethernet0/0/1]p t a v a
[Huawei-Ethernet0/0/1]int e0/0/2
[Huawei-Ethernet0/0/2]p l t
[Huawei-Ethernet0/0/2]p t a v a
[Huawei-Ethernet0/0/2]q
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]p h p v 10
[Huawei-GigabitEthernet0/0/1]p h u v 10 20
[Huawei-GigabitEthernet0/0/1]q
[Huawei]stp mode mstp
[Huawei]stp region-configuration
[Huawei-mst-region]region-name huawei
[Huawei-mst-region]revision-level 1
[Huawei-mst-region]instance 1 vlan 10
[Huawei-mst-region]instance 2 vlan 20
[Huawei-mst-region]active region-configuration
[Huawei-mst-region]q
[Huawei]stp instance 1 root primary
[Huawei]stp instance 2 root secondary
[Huawei]q

LSW2

u t m
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]q
[Huawei]vlan bat 10 20
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]p l t
[Huawei-Ethernet0/0/1]p t a v a
[Huawei-Ethernet0/0/1]int e0/0/2
[Huawei-Ethernet0/0/2]p l t
[Huawei-Ethernet0/0/2]p t a v a
[Huawei-Ethernet0/0/2]q
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]p h p v 20
[Huawei-GigabitEthernet0/0/1]p h u v 10 20
[Huawei-GigabitEthernet0/0/1]q
[Huawei]s m m
[Huawei]stp region-configuration
[Huawei-mst-region]region-name huawei
[Huawei-mst-region]revision-level 1
[Huawei-mst-region]i 1 v 10
[Huawei-mst-region]i 2 v 20
[Huawei-mst-region]active region-configuration
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei-mst-region]q
[Huawei]s i 2 r p
[Huawei]s i 1 r s
[Huawei]q

LSW3
u t m
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]q
[Huawei]vlan bat 10 20
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]p l a
[Huawei-Ethernet0/0/1]p d v 10
[Huawei-Ethernet0/0/1]int e0/0/2
[Huawei-Ethernet0/0/2]p l a
[Huawei-Ethernet0/0/2]p d v 20
[Huawei-Ethernet0/0/2]q
[Huawei]int e0/0/3
[Huawei-Ethernet0/0/3]p l t
[Huawei-Ethernet0/0/3]p t a v a
[Huawei-Ethernet0/0/3]int e0/0/4
[Huawei-Ethernet0/0/4]p l t
[Huawei-Ethernet0/0/4]p t a v a
[Huawei-Ethernet0/0/4]q
[Huawei]s m m
[Huawei]stp region-configuration
[Huawei-mst-region]region-name huawei
[Huawei-mst-region]revision-level 1
[Huawei-mst-region]i 1 v 10
[Huawei-mst-region]i 2 v 20
[Huawei-mst-region]active region-configuration
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei-mst-region]q
1ping自己的网关以及2的ip和网关都能通
在这里插入图片描述

2、STP小实验2

在这里插入图片描述
R1
u t m
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]q
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 12.1.1.1 24
[Huawei-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[Huawei-GigabitEthernet0/0/1]int e0/0/0
[Huawei-Ethernet0/0/0]ip add 21.1.1.1 24
[Huawei-Ethernet0/0/0]un sh
Info: Interface Ethernet0/0/0 is not shutdown.
[Huawei-Ethernet0/0/0]int loop0
[Huawei-LoopBack0]ip add 1.1.1.1 32
[Huawei-LoopBack0]q
[Huawei]ip route-static 2.2.2.2 32 12.1.1.2
[Huawei]ip route-static 2.2.2.2 32 21.1.1.2
[Huawei]q
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]un sh
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[Huawei-GigabitEthernet0/0/0]int g0/0/0.1
[Huawei-GigabitEthernet0/0/0.1]vlan-type dot1q 10 default
[Huawei-GigabitEthernet0/0/0.1]ip add 192.168.10.1 24
[Huawei-GigabitEthernet0/0/0.1]un sh
Info: Interface GigabitEthernet0/0/0.1 is not shutdown.
[Huawei-GigabitEthernet0/0/0.1]int g0/0/0.2
[Huawei-GigabitEthernet0/0/0.2]vlan-type dot1q 20 default
[Huawei-GigabitEthernet0/0/0.2]ip add 192.168.20.1 24
[Huawei-GigabitEthernet0/0/0.2]un sh
Info: Interface GigabitEthernet0/0/0.2 is not shutdown.
[Huawei-GigabitEthernet0/0/0.2]int g0/0/0.3
[Huawei-GigabitEthernet0/0/0.3]vlan-type dot1q 30 default
[Huawei-GigabitEthernet0/0/0.3]ip add 192.168.30.1 24
[Huawei-GigabitEthernet0/0/0.3]un sh
Info: Interface GigabitEthernet0/0/0.3 is not shutdown.
[Huawei-GigabitEthernet0/0/0.3]int g0/0/0.4
[Huawei-GigabitEthernet0/0/0.4]vlan-type dot1q 40 default
[Huawei-GigabitEthernet0/0/0.4]ip add 192.168.40.1 24
[Huawei-GigabitEthernet0/0/0.4]un sh
Info: Interface GigabitEthernet0/0/0.4 is not shutdown.
[Huawei-GigabitEthernet0/0/0.4]q

R2
u t m
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]q
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 12.1.1.2 24
[Huawei-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[Huawei-GigabitEthernet0/0/1]int e0/0/0
[Huawei-Ethernet0/0/0]ip add 21.1.1.2 24
[Huawei-Ethernet0/0/0]un sh
Info: Interface Ethernet0/0/0 is not shutdown.
[Huawei-Ethernet0/0/0]int loop 0
[Huawei-LoopBack0]ip add 2.2.2.2 32
[Huawei-LoopBack0]q
[Huawei]ip route-static 1.1.1.1 32 12.1.1.1
[Huawei]ip route-static 1.1.1.1 32 21.1.1.1
[Huawei]q
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]un sh
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[Huawei-GigabitEthernet0/0/0]int g0/0/0.1
[Huawei-GigabitEthernet0/0/0.1]vlan-type dot1q 10 default
[Huawei-GigabitEthernet0/0/0.1]ip add 192.168.10.1 24
[Huawei-GigabitEthernet0/0/0.1]un sh
Info: Interface GigabitEthernet0/0/0.1 is not shutdown.
[Huawei-GigabitEthernet0/0/0.1]int g0/0/0.2
[Huawei-GigabitEthernet0/0/0.2]vlan-type dot1q 20 default
[Huawei-GigabitEthernet0/0/0.2]ip add 192.168.20.1 24
[Huawei-GigabitEthernet0/0/0.2]un sh
Info: Interface GigabitEthernet0/0/0.2 is not shutdown.
[Huawei-GigabitEthernet0/0/0.2]int g0/0/0.3
[Huawei-GigabitEthernet0/0/0.3]vlan-type dot1q 30 default
[Huawei-GigabitEthernet0/0/0.3]ip add 192.168.30.1 24
[Huawei-GigabitEthernet0/0/0.3]un sh
Info: Interface GigabitEthernet0/0/0.3 is not shutdown.
[Huawei-GigabitEthernet0/0/0.3]int g0/0/0.4
[Huawei-GigabitEthernet0/0/0.4]vlan-type dot1q 40 default
[Huawei-GigabitEthernet0/0/0.4]ip add 192.168.40.1 24
[Huawei-GigabitEthernet0/0/0.4]un sh
Info: Interface GigabitEthernet0/0/0.4 is not shutdown.
[Huawei-GigabitEthernet0/0/0.4]q

LSW1
u t m
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]q
[Huawei]vlan bat 10 20 30 40
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]p l t
[Huawei-Ethernet0/0/1]p t a v a
[Huawei-Ethernet0/0/1]int e0/0/2
[Huawei-Ethernet0/0/2]p l t
[Huawei-Ethernet0/0/2]p t a v a
[Huawei-Ethernet0/0/2]int e0/0/3
[Huawei-Ethernet0/0/3]p l t
[Huawei-Ethernet0/0/3]p t a v a
[Huawei-Ethernet0/0/3]int e0/0/22
[Huawei-Ethernet0/0/22]p l t
[Huawei-Ethernet0/0/22]p t a v a
[Huawei-Ethernet0/0/22]q
[Huawei]stp mode mstp
[Huawei]stp region-configuration
[Huawei-mst-region]region-name huawei
[Huawei-mst-region]revision-level 1
[Huawei-mst-region]instance 1 vlan 10 20
[Huawei-mst-region]instance 2 vlan 30 40
[Huawei-mst-region]active region-configuration
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei-mst-region]q
[Huawei]stp instance 1 root primary
[Huawei]stp instance 2 root secondary
[Huawei]q

LSW2
u t m
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]q
[Huawei]vlan bat 10 20 30 40
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]p l t
[Huawei-Ethernet0/0/1]p t a v a
[Huawei-Ethernet0/0/1]int e0/0/2
[Huawei-Ethernet0/0/2]p l t
[Huawei-Ethernet0/0/2]p t a v a
[Huawei-Ethernet0/0/2]int e0/0/3
[Huawei-Ethernet0/0/3]p l t
[Huawei-Ethernet0/0/3]p t a v a
[Huawei-Ethernet0/0/3]int e0/0/22
[Huawei-Ethernet0/0/22]p l t
[Huawei-Ethernet0/0/22]p t a v a
[Huawei-Ethernet0/0/22]q
[Huawei]stp mode mstp
[Huawei]stp region-configuration
[Huawei-mst-region]region-name huawei
[Huawei-mst-region]revision-level 1
[Huawei-mst-region]instance 1 vlan 10 20
[Huawei-mst-region]instance 2 vlan 30 40
[Huawei-mst-region]active region-configuration
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei-mst-region]q
[Huawei]stp instance 2 root primary
[Huawei]stp instance 1 root secondary
[Huawei]q

LSW3
u t m
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]q
[Huawei]vlan bat 10 20 30 40
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]p l a
[Huawei-Ethernet0/0/1]p d v 10
[Huawei-Ethernet0/0/1]int e0/0/2
[Huawei-Ethernet0/0/2]p l a
[Huawei-Ethernet0/0/2]p d v 20
[Huawei-Ethernet0/0/2]int e0/0/3
[Huawei-Ethernet0/0/3]p l t
[Huawei-Ethernet0/0/3]p t a v a
[Huawei-Ethernet0/0/3]int e0/0/4
[Huawei-Ethernet0/0/4]p l t
[Huawei-Ethernet0/0/4]p t a v a
[Huawei-Ethernet0/0/4]q
[Huawei]stp mode mstp
[Huawei]stp region-configuration
[Huawei-mst-region]region-name huawei
[Huawei-mst-region]revision-level 1
[Huawei-mst-region]instance 1 vlan 10 20
[Huawei-mst-region]instance 2 vlan 30 40
[Huawei-mst-region]active region-configuration
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei-mst-region]q

LSW4
u t m
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]q
[Huawei]vlan bat 10 20 30 40
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]p l a
[Huawei-Ethernet0/0/1]p d v 30
[Huawei-Ethernet0/0/1]int e0/0/2
[Huawei-Ethernet0/0/2]p l a
[Huawei-Ethernet0/0/2]p d v 40
[Huawei-Ethernet0/0/2]int e0/0/3
[Huawei-Ethernet0/0/3]p l t
[Huawei-Ethernet0/0/3]p t a v a
[Huawei-Ethernet0/0/3]int e0/0/4
[Huawei-Ethernet0/0/4]p l t
[Huawei-Ethernet0/0/4]p t a v a
[Huawei-Ethernet0/0/4]q
[Huawei]stp mode mstp
[Huawei]stp region-configuration
[Huawei-mst-region]region-name huawei
[Huawei-mst-region]revision-level 1
[Huawei-mst-region]instance 1 vlan 10 20
[Huawei-mst-region]instance 2 vlan 30 40
[Huawei-mst-region]active region-configuration
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei-mst-region]q
全网互通
在这里插入图片描述
在这里插入图片描述

3、STP小实验3

在这里插入图片描述
R1
u t m
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]q
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 192.168.10.1 24
[Huawei-GigabitEthernet0/0/0]un sh
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 192.168.20.1 24
[Huawei-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[Huawei-GigabitEthernet0/0/1]q

LSW1
u t m
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]q
[Huawei]lacp priority 1000
[Huawei]int eth-trunk 1
[Huawei-Eth-Trunk1]bpdu enable
[Huawei-Eth-Trunk1]mode lacp-static
[Huawei-Eth-Trunk1]q
[Huawei]int e0/0/2
[Huawei-Ethernet0/0/2]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei-Ethernet0/0/2]int e0/0/3
[Huawei-Ethernet0/0/3]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei-Ethernet0/0/3]int e0/0/4
[Huawei-Ethernet0/0/4]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei-Ethernet0/0/4]q
[Huawei]int eth-trunk 1
[Huawei-Eth-Trunk1]max active-linknumber 2
[Huawei-Eth-Trunk1]q
[Huawei]vlan bat 10 20
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]p l t
[Huawei-Ethernet0/0/1]p t a v a
[Huawei-Ethernet0/0/2]int eth-trunk 1
[Huawei-Eth-Trunk1]p l t
[Huawei-Eth-Trunk1]p t a v a
[Huawei-Eth-Trunk1]q
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]p h p v 10
[Huawei-GigabitEthernet0/0/1]p h u v 10 20
[Huawei-GigabitEthernet0/0/1]q
[Huawei]stp mode mstp
[Huawei]stp region-configuration
[Huawei-mst-region]region-name huawei
[Huawei-mst-region]revision-level 1
[Huawei-mst-region]i 1 v 10
[Huawei-mst-region]i 2 v 20
[Huawei-mst-region]active region-configuration
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei-mst-region]q
[Huawei]stp instance 1 root primary
[Huawei]stp instance 2 root secondary
[Huawei]q

LSW2
u t m
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]q
[Huawei]int eth-trunk 1
[Huawei-Eth-Trunk1]bpdu enable
[Huawei-Eth-Trunk1]mode lacp-static
[Huawei-Eth-Trunk1]int e0/0/2
[Huawei-Ethernet0/0/2]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei-Ethernet0/0/2]int e0/0/3
[Huawei-Ethernet0/0/3]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei-Ethernet0/0/3]int e0/0/4
[Huawei-Ethernet0/0/4]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei-Ethernet0/0/4]q
[Huawei]int eth-trunk 1
[Huawei-Eth-Trunk1]max active-linknumber 2
[Huawei-Eth-Trunk1]q
[Huawei]vlan bat 10 20
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]p l t
[Huawei-Ethernet0/0/1]p t a v a
[Huawei-Ethernet0/0/1]q
[Huawei]int eth-trunk 1
[Huawei-Eth-Trunk1]p l t
[Huawei-Eth-Trunk1]p t a v a
[Huawei-Eth-Trunk1]q
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]p h p v 20
[Huawei-GigabitEthernet0/0/1]p h u v 10 20
[Huawei-GigabitEthernet0/0/1]q
[Huawei]s m m
[Huawei]stp region-configuration
[Huawei-mst-region]region-name huawei
[Huawei-mst-region]revision-level 1
[Huawei-mst-region]i 1 v 10
[Huawei-mst-region]i 2 v 20
[Huawei-mst-region]active region-configuration
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei-mst-region]q
[Huawei]stp instance 2 root primary
[Huawei]stp instance 1 root secondary
[Huawei]q

LSW3
u t m
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]q
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]p l a
[Huawei-Ethernet0/0/1]q
[Huawei]vlan bat 10 20
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]p l a
[Huawei-Ethernet0/0/1]p d v 10
[Huawei-Ethernet0/0/1]int e0/0/2
[Huawei-Ethernet0/0/2]p l a
[Huawei-Ethernet0/0/2]p d v 20
[Huawei-Ethernet0/0/2]q
[Huawei]int e0/0/4
[Huawei-Ethernet0/0/4]p l t
[Huawei-Ethernet0/0/4]p t a v a
[Huawei-Ethernet0/0/4]int e0/0/3
[Huawei-Ethernet0/0/3]p l t
[Huawei-Ethernet0/0/3]p t a v a
[Huawei-Ethernet0/0/3]q
[Huawei]s m m
[Huawei]stp region-configuration
[Huawei-mst-region]region-name huawei
[Huawei-mst-region]revision-level 1
[Huawei-mst-region]i 1 v 10
[Huawei-mst-region]i 2 v 20
[Huawei-mst-region]active region-configuration
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei-mst-region]q
1ping自己的网关和2的ip、网关都能通
在这里插入图片描述

  • 2
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值