检验和调试:
检验:
show standby [接口 [组]][active|init|listen|standby][brief]
如:
show standby Ethernet0 init brief
调试:
debug standby:显示所有的HSRP错误、事件和数据包
debug standby terse :显示除hello和通告以外的所有HSRP错误、事件和数据包
debug standby events detail:显示HSRP事件
debug standby error:显示HSRP错误
debug standby packets [advertise|coup|hello|resign][detail]
案例:
案例: sw1(config)#int vlan 10 sw1(config-if)#ip address 192.168.1.1 255.255.255.0 sw1(config-if)#standby 1 ip 192.168.1.254 sw1(config-if)#standby 1 priority 110 ----------------------------------------------------- sw2(config)#int vlan 10 sw2(config-if)#ip address 192.168.1.2 255.255.255.0 sw2(config-if)#standby 1 ip 192.168.1.254 sw2(config-if)#standby 1 priority 100 ------------------------------------------------------ SW1#show standby Vlan10 - Group 1 State is Active 2 state changes, last state change 00:02:38 Virtual IP address is 192.168.1.254 Active virtual MAC address is 0000.0c07.ac01 Local virtual MAC address is 0000.0c07.ac01 (v1 default) Hello time 3 sec, hold time 10 sec Next hello sent in 0.124 secs Preemption enabled Active router is local Standby router is 192.168.1.2, priority 100 (expires in 7.992 sec) Priority 110 (configured 110) IP redundancy name is "hsrp-Vl10-1" (default) --------------------------------------------------------- SW2#show standy Vlan10 - Group 1 State is Standby 1 state change, last state change 00:02:32 Virtual IP address is 192.168.1.254 Active virtual MAC address is 0000.0c07.ac01 Local virtual MAC address is 0000.0c07.ac01 (v1 default) Hello time 3 sec, hold time 10 sec Next hello sent in 0.328 secs Preemption enabled Active router is 192.168.1.1, priority 110 (expires in 9.456 sec) Standby router is local Priority 100 (default 100) IP redundancy name is "hsrp-Vl10-1" (default) SW1#show stan brie P indicates configured to preempt. | Interface Grp Prio P State Active Standby Virtual IP V10 1 110 P Active local 192.168.1.2 192.168.1.254 |
多组HSRP备用组:
Router A Configuration Switch# configure terminal Switch(config)# interface gigabitethernet0/1 Switch(config-if)# no switchport Switch(config-if)# ip address 10.0.0.1 255.255.255.0 Switch(config-if)# standby 1 ip 10.0.0.3 Switch(config-if)# standby 1 priority 110 Switch(config-if)# standby 1 preempt Switch(config-if)# standby 2 ip 10.0.0.4 Switch(config-if)# standby 2 preempt Switch(config-if)# end Router B Configuration Switch# configure terminal Switch(config)# interface gigabitethernet0/1 Switch(config-if)# no switchport Switch(config-if)# ip address 10.0.0.2 255.255.255.0 Switch(config-if)# standby 1 ip 10.0.0.3 Switch(config-if)# standby 1 preempt Switch(config-if)# standby 2 ip 10.0.0.4 Switch(config-if)# standby 2 priority 110 Switch(config-if)# standby 2 preempt Switch(config-if)# end |