公告:魔扣目录网为广大站长提供免费收录网站服务,提交前请做好本站友链:【 网站目录:https://www.morko.net 】, 免友链快审服务(50元/站),

点击这里在线咨询客服
新站提交
  • 网站:51998
  • 待审:31
  • 小程序:12
  • 文章:1030137
  • 会员:747

生成树协议(英语:Spanning Tree Protocol,STP),是一种工作在OSI网络模型中的第二层(数据链路层)的通信协议,基本应用是防止交换机冗余链路产生的环路.用于确保以太网中无环路的逻辑拓扑结构.从而避免了广播风暴,大量占用交换机的资源。

案例:

生成树协议在华为交换机的简单应用

 

[SW1]stp enable

[SW1]vlan batch 10 20

[SW1]interface g0/0/1

[SW1-GigabitEthernet0/0/1]port link-type trunk

[SW1-GigabitEthernet0/0/1]port trunk allow-pass vlan all

[SW1]interface g0/0/2

[SW1-GigabitEthernet0/0/2]port link-type trunk

[SW1-GigabitEthernet0/0/2]port trunk allow-pass vlan all

配置sw2

[Huawei]sysname SW2

[SW2]vlan batch 10 20

[SW2]stp enable

[SW2]interface g0/0/1

[SW2-GigabitEthernet0/0/1]port link-type trunk

[SW2-GigabitEthernet0/0/1]port trunk allow-pass vlan all

[SW2]interface g0/0/3

[SW2-GigabitEthernet0/0/3]port link-type trunk

[SW2-GigabitEthernet0/0/3]port trunk allow-pass vlan all

配置sw3

[SW3]vlan batch 10 20

[SW3]stp enable

[SW3]interface g0/0/2

[SW3-GigabitEthernet0/0/2]port link-type trunk

[SW3-GigabitEthernet0/0/2]port trunk allow-pass vlan all

[SW3]interface g0/0/3

[SW3-GigabitEthernet0/0/3]port link-type trunk

[SW3-GigabitEthernet0/0/3]port trunk allow-pass vlan all

第二步配置stp模式

[SW1]stp mode ?

mstp Multiple Spanning Tree Protocol (MSTP) mode

rstp Rapid Spanning Tree Protocol (RSTP) mode

stp Spanning Tree Protocol (STP) mode

[SW1]stp mode stp

[SW1]stp priority 4096

[SW2]stp mode stp

[SW2]stp priority 8192

[SW3]stp mode stp

[SW1]display stp

-------[CIST Global Info][Mode STP]-------

CIST Bridge :4096 .4c1f-cc1b-22ed

Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20

Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20

CIST Root/ERPC :4096 .4c1f-cc1b-22ed / 0

CIST RegRoot/IRPC :4096 .4c1f-cc1b-22ed / 0

CIST RootPortId :0.0

BPDU-Protection :Disabled

TC or TCN received :7

TC count per hello :0

STP Converge Mode :Normal

Time since last TC :0 days 0h:1m:33s

Number of TC :9

Last TC occurred :GigabitEthernet0/0/2

生成树协议在华为交换机的简单应用

 

[SW2]display stp

-------[CIST Global Info][Mode STP]-------

CIST Bridge :8192 .4c1f-cca6-0f90

Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20

Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20

CIST Root/ERPC :4096 .4c1f-cc1b-22ed / 20000

CIST RegRoot/IRPC :8192 .4c1f-cca6-0f90 / 0

CIST RootPortId :128.1

BPDU-Protection :Disabled

TC or TCN received :42

TC count per hello :0

STP Converge Mode :Normal

Time since last TC :0 days 0h:4m:13s

Number of TC :8

Last TC occurred :GigabitEthernet0/0/1

生成树协议在华为交换机的简单应用

 

[SW3]display stp

-------[CIST Global Info][Mode STP]-------

CIST Bridge :32768.4c1f-ccf2-7f99

Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20

Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20

CIST Root/ERPC :4096 .4c1f-cc1b-22ed / 20000

CIST RegRoot/IRPC :32768.4c1f-ccf2-7f99 / 0

CIST RootPortId :128.2

BPDU-Protection :Disabled

TC or TCN received :66

TC count per hello :0

STP Converge Mode :Normal

Time since last TC :0 days 0h:5m:59s

Number of TC :9

Last TC occurred :GigabitEthernet0/0/2

生成树协议在华为交换机的简单应用

 

现在来查看一下sw2的g0/0/1的stp状态

[SW2]display stp interface g0/0/1

-------[CIST Global Info][Mode STP]-------

CIST Bridge :8192 .4c1f-cca6-0f90

Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20

Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20

CIST Root/ERPC :4096 .4c1f-cc1b-22ed / 20000

CIST RegRoot/IRPC :8192 .4c1f-cca6-0f90 / 0

CIST RootPortId :128.1

BPDU-Protection :Disabled

TC or TCN received :42

TC count per hello :0

STP Converge Mode :Normal

Time since last TC :0 days 0h:9m:55s

Number of TC :8

Last TC occurred :GigabitEthernet0/0/1

----[Port1(GigabitEthernet0/0/1)][FORWARDING]----

Port Protocol :Enabled

Port Role :Root Port

Port Priority :128

Port Cost(Dot1T ) :Config=auto / Active=20000

Designated Bridge/Port :4096.4c1f-cc1b-22ed / 128.1

Port Edged :Config=default / Active=disabled

Point-to-point :Config=auto / Active=true

Transit Limit :147 packets/hello-time

Protection Type :None

Port STP Mode :STP

Port Protocol Type :Config=auto / Active=dot1s

BPDU Encapsulation :Config=stp / Active=stp

PortTimes :Hello 2s MaxAge 20s FwDly 15s RemHop 0

TC or TCN send :2

TC or TCN received :35

BPDU Sent :3

TCN: 2, Config: 1, RST: 0, MST: 0

BPDU Received :303

TCN: 0, Config: 303, RST: 0, MST: 0

生成树协议在华为交换机的简单应用
 

分享到:
标签:交换机
用户无头像

网友整理

注册时间:

网站:5 个   小程序:0 个  文章:12 篇

  • 51998

    网站

  • 12

    小程序

  • 1030137

    文章

  • 747

    会员

赶快注册账号,推广您的网站吧!
最新入驻小程序

数独大挑战2018-06-03

数独一种数学游戏,玩家需要根据9

答题星2018-06-03

您可以通过答题星轻松地创建试卷

全阶人生考试2018-06-03

各种考试题,题库,初中,高中,大学四六

运动步数有氧达人2018-06-03

记录运动步数,积累氧气值。还可偷

每日养生app2018-06-03

每日养生,天天健康

体育训练成绩评定2018-06-03

通用课目体育训练成绩评定