交换知识点(STP)
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
交换知识点整理(部分)
一.交换机的作用
1.MAC地址学习
2.帧的转发,过滤
3.防环
PC上查看MAC地址命令:
PC>ipconfig /all
FastEthernet0 Connection:(default port)
Physical Address................: 0001.9782.7064
交换机查看MAC地址表命令:
Switch#sh mac-address-table
Mac Address Table
-------------------------------------------
Vlan Mac Address Type Ports
---- ----------- -------- -----
1 0001.9782.7064 DYNAMIC Fa0/2
1 0001.9792.b97c DYNAMIC Fa0/1
二.冗余网络带来的问题
1.广播风暴
2.重复帧
3.MAC地址表不稳定
三.解决冗余网络问题的方案:生成树协议Spanning Tree Protocol(STP)
1.生成树
桥ID(比小):①priority(默认32768)②MAC地址
CISCO默认使用每VLAN生成树(PVST)
桥ID(比小):①priority(默认32768)+扩展系统ID(VLAN ID)②MAC地址2.根桥ROOT BRIDGE
发送最优BPDU,管理STP
3.根端口RP
到达ROOT BRIDGE路径,代价比小
接收BPDU
每台非根桥上有且仅有一个RP
p.s.代价与连接速率的对照关系:
10Gbps→2
1Gbps→4
100Mbps→19
10Mbps→100
4.指派端口DP
转发BPDU
5.非指派端口
BLOCKING阻塞:不能够转发数据
6.STP端口状态:
阻塞(BLOCKING)→侦听(LISTENING)→学习(LEARNING)→转发(FORWARDING) 利用神器PT来研究STP生成树的工作方式
Switch0#sh spanning-tree
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32769
Address 0060.3E34.0392
Cost 19
Port 20(FastEthernet0/20)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address 00E0.A304.3AEB
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/20 Root FWD 19 128.20 P2p
Fa0/10 Altn BLK 19 128.10 P2p
Switch1#sh spanning-tree
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32769
Address 0060.3E34.0392
Cost 19
Port 5(FastEthernet0/5)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address 00E0.8FBE.7940
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/10 Desg FWD 19 128.10 P2p
Fa0/5 Root FWD 19 128.5 P2p
Switch2#sh spanning-tree
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32769
Address 0060.3E34.0392
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address 0060.3E34.0392
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/20 Desg FWD 19 128.20 P2p
Fa0/5 Desg FWD 19 128.5 P2p
抢根:
方法一:设置优先级
Switch0(config)#spanning-tree vlan 1 priority ?
<0-61440> bridge priority in increments of 4096
Switch0(config)#spanning-tree vlan 1 priority 0
Switch0#sh sp
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 1
Address 00E0.A304.3AEB
This bridge is the root
方法二:设置主备角色