实验5 RSTP

实验任务一:在交换机上配置RSTP

1. 查看环路引起的广播风暴对网络的影响
网络中存在环路,交换机所有互联端口以及连接主机的端口指示灯快速闪动,形成了广播风暴。
实际上应该是PCA无法ping通PCB,但是在模拟器上可以ping通。
2. 在交换机上启动RSTP
[SWA]stp mode rstp
[SWA]stp global enable
SWA,SWB,SWC,SWD进行同样的配置后,实际上PCA可以ping通PCB
3. 查看网络中的根桥
[SWA]display stp root
MST ID Root Bridge ID ExtPathCost IntPathCost Root Port
0 32768.a601-c9ef-0200 0 0

[SWB]display stp root
MST ID Root Bridge ID ExtPathCost IntPathCost Root Port
0 32768.a601-c9ef-0200 20 0 GE1/0/1
[SWC]display stp root
MST ID Root Bridge ID ExtPathCost IntPathCost Root Port
0 32768.a601-c9ef-0200 20 0 GE1/0/4
[SWD]display stp root
MST ID Root Bridge ID ExtPathCost IntPathCost Root Port
0 32768.a601-c9ef-0200 20 0 GE1/0/2
由上面可以看到SWA没有根端口,SWA是根端口
[SWA]display interface GigabitEthernet 1/0/2
GigabitEthernet1/0/2
Current state: UP
Line protocol state: UP
IP packet frame type: Ethernet II, hardware address: a601-c9ef-0200
可以看到根桥的MAC地址。

[SWB]display stp brief
MST ID Port Role STP State Protection
0 GigabitEthernet1/0/1 ROOT FORWARDING NONE
0 GigabitEthernet1/0/2 DESI FORWARDING NONE
可以看到端口角色和端口状态。

[SWB]display stp
-------[CIST Global Info][Mode RSTP]-------
Bridge ID : 32768.a601-ceba-0300//桥ID
Bridge times : Hello 2s MaxAge 20s FwdDelay 15s MaxHops 20
Root ID/ERPC : 32768.a601-c9ef-0200, 20//根桥ID和根路径开销
RegRoot ID/IRPC : 32768.a601-ceba-0300, 0//桥ID
RootPort ID : 128.2//根端口ID
BPDU-Protection : Disabled
Bridge Config-
Digest-Snooping : Disabled
TC or TCN received : 12
Time since last TC : 0 days 0h:22m:19s
----[Port2(GigabitEthernet1/0/1)][FORWARDING]----
Port protocol : Enabled
Port role : Root Port (Boundary)
Port ID : 128.2
Port cost(Legacy) : Config=auto, Active=20
Desg.bridge/port : 32768.a601-c9ef-0200, 128.3
Port edged : Config=disabled, Active=disabled
Point-to-Point : Config=auto, Active=true
Transmit limit : 10 packets/hello-time
TC-Restriction : Disabled
Role-Restriction : Disabled
Protection type : Config=none, Active=none
MST BPDU format : Config=auto, Active=802.1s
Port Config-
Digest-Snooping : Disabled
Rapid transition : True
Num of VLANs mapped : 1
Port times : Hello 2s MaxAge 20s FwdDelay 15s MsgAge 0s RemHops 20
BPDU sent : 4
TCN: 0, Config: 0, RST: 0, MST: 4
BPDU received : 702
TCN: 0, Config: 0, RST: 353, MST: 349

----[Port3(GigabitEthernet1/0/2)][FORWARDING]----
Port protocol : Enabled
Port role : Designated Port (Boundary)
Port ID : 128.3
Port cost(Legacy) : Config=auto, Active=20
Desg.bridge/port : 32768.a601-ceba-0300, 128.3
Port edged : Config=disabled, Active=disabled
Point-to-Point : Config=auto, Active=true
Transmit limit : 10 packets/hello-time
TC-Restriction : Disabled
Role-Restriction : Disabled
Protection type : Config=none, Active=none
MST BPDU format : Config=auto, Active=802.1s
Port Config-
Digest-Snooping : Disabled
Rapid transition : True
Num of VLANs mapped : 1
Port times : Hello 2s MaxAge 20s FwdDelay 15s MsgAge 1s RemHops 20
BPDU sent : 698
TCN: 0, Config: 0, RST: 348, MST: 350
BPDU received : 3
TCN: 0, Config: 0, RST: 0, MST: 3

可以看出的桥ID=桥优先级+MAC地址,优先级默认32768,范围0-61440,步长4096
端口ID=端口优先级+端口号,优先级默认128,范围0-240.步长16

实验任务二:修改交换机的桥优先级
1.修改SWB的桥优先级
[SWB]stp priority 0
[SWB]display stp root
MST ID Root Bridge ID ExtPathCost IntPathCost Root Port
0 0.a601-ceba-0300 0 0

[SWB]display interface GigabitEthernet 1/0/1
GigabitEthernet1/0/1
Current state: UP
Line protocol state: UP
IP packet frame type: Ethernet II, hardware address: a601-ceba-0300

[SWD]display stp brief
MST ID Port Role STP State Protection
0 GigabitEthernet1/0/1 ALTE DISCARDING NONE
0 GigabitEthernet1/0/2 ROOT FORWARDING NONE
实验任务三:修改端口开销
1.查看SWDstp信息
[SWD-GigabitEthernet1/0/1]display stp
----[Port2(GigabitEthernet1/0/1)][DISCARDING]----
Port protocol : Enabled
Port role : Alternate Port (Boundary)
Port ID : 128.2
Port cost(Legacy) : Config=auto, Active=20
Desg.bridge/port : 32768.a601-d336-0400, 128.4
Port edged : Config=disabled, Active=disabled
Point-to-Point : Config=auto, Active=true
Transmit limit : 10 packets/hello-time
TC-Restriction : Disabled
Role-Restriction : Disabled
Protection type : Config=none, Active=none
MST BPDU format : Config=auto, Active=802.1s
Port Config-
Digest-Snooping : Disabled
Rapid transition : False
Num of VLANs mapped : 1
Port times : Hello 2s MaxAge 20s FwdDelay 15s MsgAge 1s RemHops 20
BPDU sent : 5
TCN: 0, Config: 0, RST: 5, MST: 0
BPDU received : 995
TCN: 0, Config: 0, RST: 995, MST: 0

----[Port3(GigabitEthernet1/0/2)][FORWARDING]----
Port protocol : Enabled
Port role : Root Port (Boundary)
Port ID : 128.3
Port cost(Legacy) : Config=auto, Active=20
Desg.bridge/port : 32768.a601-c9ef-0200, 128.4
Port edged : Config=disabled, Active=disabled
Point-to-Point : Config=auto, Active=true
Transmit limit : 10 packets/hello-time
TC-Restriction : Disabled
Role-Restriction : Disabled
Protection type : Config=none, Active=none
MST BPDU format : Config=auto, Active=802.1s
Port Config-
Digest-Snooping : Disabled
Rapid transition : True
Num of VLANs mapped : 1
Port times : Hello 2s MaxAge 20s FwdDelay 15s MsgAge 1s RemHops 20
BPDU sent : 3
TCN: 0, Config: 0, RST: 3, MST: 0
BPDU received : 995
TCN: 0, Config: 0, RST: 995, MST: 0
2.修改SWD的端口开销
[SWD-GigabitEthernet1/0/2]stp cost 40
3.查看修改后SWD的stp信息
----[Port2(GigabitEthernet1/0/1)][FORWARDING]----
Port protocol : Enabled
Port role : Root Port (Boundary)
Port ID : 128.2
Port cost(Legacy) : Config=auto, Active=20
Desg.bridge/port : 32768.a601-d336-0400, 128.4
Port edged : Config=disabled, Active=disabled
Point-to-Point : Config=auto, Active=true
Transmit limit : 10 packets/hello-time
TC-Restriction : Disabled
Role-Restriction : Disabled
Protection type : Config=none, Active=none
MST BPDU format : Config=auto, Active=802.1s
Port Config-
Digest-Snooping : Disabled
Rapid transition : True
Num of VLANs mapped : 1
Port times : Hello 2s MaxAge 20s FwdDelay 15s MsgAge 1s RemHops 20
BPDU sent : 6
TCN: 0, Config: 0, RST: 6, MST: 0
BPDU received : 1091
TCN: 0, Config: 0, RST: 1091, MST: 0

----[Port3(GigabitEthernet1/0/2)][DISCARDING]----
Port protocol : Enabled
Port role : Alternate Port (Boundary)
Port ID : 128.3
Port cost(Legacy) : Config=40, Active=40
Desg.bridge/port : 32768.a601-c9ef-0200, 128.4
Port edged : Config=disabled, Active=disabled
Point-to-Point : Config=auto, Active=true
Transmit limit : 10 packets/hello-time
TC-Restriction : Disabled
Role-Restriction : Disabled
Protection type : Config=none, Active=none
MST BPDU format : Config=auto, Active=802.1s
Port Config-
Digest-Snooping : Disabled
Rapid transition : True
Num of VLANs mapped : 1
Port times : Hello 2s MaxAge 20s FwdDelay 15s MsgAge 1s RemHops 20
BPDU sent : 3
TCN: 0, Config: 0, RST: 3, MST: 0
BPDU received : 1091
TCN: 0, Config: 0, RST: 1091, MST: 0

根据链路速率,默认是20,修改成40后,转变后Alternate口,ge1/0/1成为了新根端口。
实验任务四:配置边缘端口

  1. SWA和SWC的ge1/0/1配置为边缘端口。
    [SWA-GigabitEthernet1/0/1]stp edged-port
    [SWC-GigabitEthernet1/0/1]stp edged-port
    再次测试PCA可以ping通PCB,断开PCA或PCB连接后,再恢复连接,发现两台主机可以立即ping通对方, 即边缘端口可以立即进入Forwarding状态。

补充命令:
1.修改端口优先级
[H3C-GigabitEthernet1/0/1]stp port priority x
2. 修改桥优先级
[H3C]stp [instance x] priority y
3. 配置网络直径
[H3C]stp bridge-diameter x //范围2-7,默认是7
4. 全局视图执行mCheck操作
//当RSTP向下兼容STP,想恢复回RSTP,输入此命令
[H3C]stp global mcheck
[H3C-GigabitEthernet1/0/1]stp mcheck

posted @ 2019-07-07 22:27  Akiz  阅读(1052)  评论(0)    收藏  举报