快速生成树
Rapid Spanning tree protocolRSTP
IEEE 802.1w
RSTP端口角色
根端口、指定端口和阻塞端口
替代端口、备用端口
RSTP端口状态
丢弃、学习、转发
RSTP收敛
如果交换机连续三次没有收到邻接的BPDU信息则认为邻接交换机出现故障,默认的hello时间是两秒,所以RSTP发现故障的时间是6秒,STP的最大寿命是20秒。
PVST+模式更改为RPVST+switch(config):spanning-tree mode rapid-pvst
MST多生成树协议IEEE802.1s定义
启用MST模式
Switch(config)#spanning-tree mode mst
进入MST配置模式
Switch(config)#spanning-tree mst configuration
配置MST区域名
Switch(config-mst)#name name
配置区域配置修订号
Switch(config-mst)#revision version
VLAN映射到MST实例
Switch(config-mst)#instance instance-id vlan vlan-list
 
HSRP消息
使用UDP,端口号1985
使用组播地址224.0.0.2,TTL值为1
HSRP状态
初始状态     学习状态   监听状态   发言状态   备份状态   活跃状态   
HSRP计时器   
 Hello间隔(默认3s)   保持时间(默认10s)
热备份路由协议HSRP
Cisco私有协议
虚拟路由冗余协议VRRP
IETF制定,RFC 2338
实现原理和过程与HSRP基本相同
在协议细节上与HSRP有所区别
配置为HSRP的成员
Switchconfig-if)#standby group-number ip virtual-ip-address
配置HSRP的优先级
Switch(config-if)#standby group-number priority priority-value
 
HSRP占先权 
优先级高的路由器重新获得转发权,成为活跃路由器
HSRP占先权配置
Switch(config-if#standby group-number preempt
HSRP计时器配置
配置Hello间隔和保持时间
Switch(config-if)#standby group-number times hellotime holdtime
HSRP端口跟踪
跟踪端口不可用时,HSRP优先级降低
活跃路由器可以根据线路情况自动调整
 
查看HSRP摘要信息
Switch#show standby [type mod/num] [group-number] brief
查看HSRP详细信息
Switch#show standby
 
 
STP和热备份实验
实验要求:SW1-3L配置为VLAN2的根网桥
          SW2-3L配置为VLAN34的根网桥
          虚拟IP地址 VLAN2 192.168.2.254/24
         PC网关) VLAN3 192.168.3.254/24
                      VLAN4 192.18.4.254/24
实验配置:
SW1-3L
en
conf t
lin co 0
logg sy
exec-t 0 0
exi
no ip do lo
ip routi
int r f0/13 -15
sw m tr 
exi
exi
vlan d
vlan 2
vlan 3
vlan 4
exi
conf t
spann vl 2 root pri
spann vl 3 root sec
spann vl 4 root sec
int vlan 2
ip add 192.168.2.1 255.255.255.0
no sh
standby 2 ip 192.168.1.254
standby 2 pri 200
standby 2 pree
standby 2 track f0/13 100
standby 2 track f0/14 100
int vl 3
ip add 192.168.3.1 255.255.255.0
no sh
standby 3 ip 192.168.3.254
standby 3 pri 150
standby 3 pree
int vl 4
ip add 192.168.4.1 255.255.255.0
no sh
standby 4 ip 192.168.4.254
standby 4 pri 150
standby 4 pree
 
SW2-3L
 
en
conf t
lin co 0
logg sy
exec-t 0 0
exi
no ip do lo
ip routi
int r f0/13 -15
sw m tr 
exi
exi
vlan d
vlan 2
vlan 3
vlan 4
exi
conf t
spann vl 3 root pri
spann vl 4 root pri
spann vl 2 root sec
int vlan 2
ip add 192.168.2.2 255.255.255.0
no sh
standby 2 ip 192.168.2.254
standby 2 pri 150
standby 2 pree
int vl 3
ip add 192.168.3.2 255.255.255.0
no sh
standby 3 ip 192.168.3.254
standby 3 pri 200
standby 3 pree
standby 3 track f0/13 100
int vl 4
ip add 192.168.4.2 255.255.255.0
no sh
standby 4 ip 192.168.4.254
standby 4 pri 200
standby 4 pree
standby 3 track f0/14 10
 
 
 
 
 
SW3
en
conf t
lin co 0
logg sy
exec-t 0 0
exi
no ip do lo
int r f0/13 -14
sw m tr 
exi
exi
vlan d
vlan 2
vlan 3
vlan 4
exi
conf t
int f0/1
sw acc vl 2
int f0/2
sw acc vl 3
 
SW4
en
conf t
lin co 0
logg sy
exec-t 0 0
exi
no ip do lo
int r f0/13 -14
sw m tr 
exi
exi
vlan d
vlan 2
vlan 3
vlan 4
exi
conf t
int f0/1
sw acc vl 2
int f0/2
sw acc vl 4