实验报告

实验时间:
2009-02-21
实验人:
蔡连军
实验名称:配置热备份路由协议(HSRP
实验任务和目标:
1.        HSRP的基本配置,可以全网互通。
2.        配置HSRP的优先级。
3.        配置HSRP的占先权。
4.        配置Hello消息计时器。(注意:一般此项不做更改)
5.        配置HSRP的端口追踪。
实验环境描述:
北京星辰集团是一家知名软件开发公司,由于市场占有率及其公司规模的不断扩大,每天都有大量的客户需要访问服务器和公司员工需要获取更多的信息,使得公司的一台路由器时不时的出现问题,给公司的发展带来很多不变。星辰公司希望能让公司24小时保持Internet连接。
实验拓扑及网络规划:
根据公司需求,为公司设计如图所示的解决方案,用两台Cisco 3640路由器来连接Internet,使用HSRP协议
让不同vlan的主机或服务器通过不同的路由器连接外网,即实现了网关的备份又可以做到负载。
实验操作过程及配置说明,配置结果已包含在其中:
1.在路由器上配置HSRP,并实现全网互通。
1.1R1e0/0口和R2e0/0口划分到HSRP 1中,配置HSRP 1组的虚拟路由器的ip192.168.1.100/24.
R1
r1(config)#int e0/0
r1(config-if)#ip add 192.168.1.1 255.255.255.0
r1(config-if)#no sh
r1(config-if)#
*Mar  1 00:02:35.631: %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up
*Mar  1 00:02:36.631: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to
up
r1(config-if)#standby 1 ip 192.168.1.100                               R1e0/0口加入到组HSRP 1        
*Mar  1 00:03:23.771: %HSRP-5-STATECHANGE: Ethernet0/0 Grp 1 state Speak -> Standby
*Mar  1 00:03:24.271: %HSRP-5-STATECHANGE: Ethernet0/0 Grp 1 state Standby -> Active
r1(config-if)#duplex full
r1(config-if)#no ip redirects                       关闭端口重定向,默认开启HSRP后已经关闭
r1(config-if)#
R2
r2(config)#int e0/0
r2(config-if)#ip add 192.168.1.2 255.255.255.0
r2(config-if)#no sh
*Mar  1 00:06:23.507: %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up
*Mar  1 00:06:24.507: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to
up
r2(config-if)#standby 1 ip 192.168.1.100                      R2e0/0口加入到组HSRP 1
*Mar  1 00:06:39.135: %CDP-4-DUPLEX_MISMATCH: duplex mismatch discovered on Ethernet0/0 (not full du
plex), with s1 FastEthernet0/1 (full duplex).
r2(config-if)#duplex full                                            将端口陪为全双工
*Mar  1 00:07:12.527: %HSRP-5-STATECHANGE: Ethernet0/0 Grp 1 state Speak -> Standby
r2(config-if)#no ip redirects                                               
r2(config-if)#end
*Mar  1 00:13:41.739: %SYS-5-CONFIG_I: Configured from console by console
r2#show standby
Ethernet0/0 - Group 1
  State is Standby
    1 state change, last state change 00:06:40
  Virtual IP address is 192.168.1.100           HSRP 1虚拟路由器IP
  Active virtual MAC address is 0000.0c07.ac01                        虚拟MAC地址,自动生成的
    Local virtual MAC address is 0000.0c07.ac01 (v1 default)
  Hello time 3 sec, hold time 10 sec               发送hello消息间隔时间为3s,保留时间为10s
    Next hello sent in 1.084 secs        离下一次发送hellp的时间为1.084s
  Preemption disabled                                           没有启用占先权
  Active router is 192.168.1.1, priority 100 (expires in 9.880 sec)  活动路由器ip192.168.1.1,其优先级为100
  Standby router is local                                    本机为备份路由器
  Priority 100 (default 100)                HSRP中路由器默认优先级为100
  IP redundancy name is "hsrp-Et0/0-1" (default)
R1
r1(config-if)#int e0/1
r1(config-if)#ip add 192.168.2.1 255.255.255.0
r1(config-if)#no sh
*Mar  1 00:16:42.515: %LINK-3-UPDOWN: Interface Ethernet0/1, changed state to up
*Mar  1 00:16:43.515: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/1, changed state to
up
r1(config-if)#standby 2 ip 192.168.2.200                          R1e0/1口加入到组HSRP 2
r1(config-if)#
*Mar  1 00:17:18.543: %HSRP-5-STATECHANGE: Ethernet0/1 Grp 2 state Speak -> Standby
*Mar  1 00:17:19.043: %HSRP-5-STATECHANGE: Ethernet0/1 Grp 2 state Standby -> Active
r1(config-if)#no ip redirects
r1(config-if)#duplex full
r1(config-if)#
 
R2
r2(config)#int e0/1
r2(config-if)#ip add 192.168.2.2 255.255.255.0
r2(config-if)#no sh
*Mar  1 00:18:07.191: %LINK-3-UPDOWN: Interface Ethernet0/1, changed state to up
*Mar  1 00:18:08.191: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/1, changed state to
up
r2(config-if)#standby 2 ip 192.168.2.200                      R2e0/1口加入到组HSRP 2
r2(config-if)#no ip redirects
r2(config-if)#duplex full
r2(config-if)#^Z
r2#
*Mar  1 00:18:41.915: %HSRP-5-STATECHANGE: Ethernet0/1 Grp 2 state Speak -> Standby
*Mar  1 00:18:41.919: %SYS-5-CONFIG_I: Configured from console by console
r2#show standby
Ethernet0/0 - Group 1
  State is Standby
    1 state change, last state change 00:11:50
  Virtual IP address is 192.168.1.100
  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.276 secs
  Preemption disabled
  Active router is 192.168.1.1, priority 100 (expires in 9.072 sec)
  Standby router is local
  Priority 100 (default 100)
  IP redundancy name is "hsrp-Et0/0-1" (default)
Ethernet0/1 - Group 2
  State is Standby
    1 state change, last state change 00:00:21
  Virtual IP address is 192.168.2.200                                    虚拟路由器ip
  Active virtual MAC address is 0000.0c07.ac02                                虚拟路由器MAC
    Local virtual MAC address is 0000.0c07.ac02 (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 2.664 secs
  Preemption disabled
  Active router is 192.168.2.1, priority 100 (expires in 9.820 sec)                     活动路由器ip及其优先级
  Standby router is local                                        本地为备份路由器
  Priority 100 (default 100)
  IP redundancy name is "hsrp-Et0/1-2" (default)
 
1.2配置PC机,测试全网互通:
VPCS 1 >ip 192.168.1.3 192.168.1.100 24              配置PC1IP网关为组1虚拟路由器的IP
PC1 : 192.168.1.3 255.255.255.0 gateway 192.168.1.100
VPCS 1 >2
VPCS 2 >ip 192.168.1.4 192.168.1.2 24                            配置PC2IP网关为R2e0/0口的IP
PC2 : 192.168.1.4 255.255.255.0 gateway 192.168.1.2
VPCS 2 >3
VPCS 3 >ip 192.168.2.3 192.168.2.200 24                  配置PC3IP网关为组2虚拟路由器的IP
PC3 : 192.168.2.3 255.255.255.0 gateway 192.168.2.200
 
VPCS 3 >show ip
 
NAME   IP/CIDR              GATEWAY           LPORT   RPORT
PC1    192.168.1.3/24       192.168.1.100     10001   21002
PC2    192.168.1.4/24       192.168.1.2       10002   21003
PC3    192.168.2.3/24       192.168.2.200     10003   22002
 
VPCS 3 >ping 192.168.1.3
192.168.1.3 icmp_seq=1 timeout
192.168.1.3 icmp_seq=2 time=125.000 ms
192.168.1.3 icmp_seq=3 time=62.000 ms
192.168.1.3 icmp_seq=4 time=47.000 ms
192.168.1.3 icmp_seq=5 time=47.000 ms
 
VPCS 3 >ping 192.168.1.4
192.168.1.4 icmp_seq=1 timeout
192.168.1.4 icmp_seq=2 time=93.000 ms
192.168.1.4 icmp_seq=3 time=63.000 ms
192.168.1.4 icmp_seq=4 time=125.000 ms
192.168.1.4 icmp_seq=5 time=109.000 ms
 
2.配置HSRP的优先级:
R1
r1(config)#int e0/0
r1(config-if)#standby 1 priority 110                    HSRP1组中,将活动路由器的优先级改为110
r1(config-if)#int e0/1
r1(config-if)#standby 2 priority 110                    HSRP2组中,将活动路由器的优先级改为110
 
r1(config-if)#^Z
r1#
*Mar  1 00:27:39.027: %SYS-5-CONFIG_I: Configured from console by console
r1#show standby bri
                     P indicates configured to preempt.
                     |
Interface   Grp Prio P State    Active          Standby         Virtual IP
Et0/0       1   110    Active   local           192.168.1.2     192.168.1.100
Et0/1       2   110    Active   local           192.168.2.2     192.168.2.200
 
R2
r2(config)#int e0/0
r2(config-if)#standby 1 priority 120                    HSRP1组中,将备份路由器的优先级改为120
r2(config-if)#int e0/1
r2(config-if)#standby 2 priority 120                    HSRP2组中,将备份路由器的优先级改为120
r2(config-if)#^Z
r2#
*Mar  1 00:30:05.867: %SYS-5-CONFIG_I: Configured from console by console
r2#show standby
Ethernet0/0 - Group 1
  State is Standby
    1 state change, last state change 00:23:05
  Virtual IP address is 192.168.1.100
  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.464 secs
  Preemption disabled
  Active router is 192.168.1.1, priority 110 (expires in 9.256 sec)
  Standby router is local
  Priority 120 (configured 120)
  IP redundancy name is "hsrp-Et0/0-1" (default)
Ethernet0/1 - Group 2
  State is Standby
    1 state change, last state change 00:11:36
  Virtual IP address is 192.168.2.200
  Active virtual MAC address is 0000.0c07.ac02
    Local virtual MAC address is 0000.0c07.ac02 (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 2.836 secs
  Preemption disabled
  Active router is 192.168.2.1, priority 110 (expires in 6.960 sec)
  Standby router is local
  Priority 120 (configured 120)
  IP redundancy name is "hsrp-Et0/1-2" (default)
从上面的配置可以看出虽然备份路由器的优先级高于活动路由器此时备份路由器也不能自动变为活动路由器,还需在备份路由器上配置占先权才可。
R2
r2(config)#int e0/0
r2(config-if)#standby 1 preempt              HSRP1组的备份路由器配置占先权
r2(config-if)#
*Mar  1 00:32:44.415: %HSRP-5-STATECHANGE: Ethernet0/0 Grp 1 state Standby -> Active
r2(config-if)#int e0/1
r2(config-if)#do show standby
Ethernet0/0 - Group 1
  State is Active
    2 state changes, last state change 00:00:50
  Virtual IP address is 192.168.1.100
  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.388 secs
  Preemption enabled
  Active router is local                                  本地R2变为活动路由器
  Standby router is 192.168.1.1, priority 110 (expires in 8.432 sec)
  Priority 120 (configured 120)
  IP redundancy name is "hsrp-Et0/0-1" (default)
Ethernet0/1 - Group 2
  State is Standby
    1 state change, last state change 00:14:53
  Virtual IP address is 192.168.2.200
  Active virtual MAC address is 0000.0c07.ac02
    Local virtual MAC address is 0000.0c07.ac02 (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 0.884 secs
  Preemption disabled
  Active router is 192.168.2.1, priority 110 (expires in 8.072 sec)
  Standby router is local
  Priority 120 (configured 120)
  IP redundancy name is "hsrp-Et0/1-2" (default)
r2(config-if)#
在配置占要求的HSRP 1中备份路由器已经变为Active,而另了一个依然为Standby router
3. 配置Hello消息的计时器:此项的值通常是最合适的,所以建议保持该项不变
R2
r2(config-if)#int e0/0
r2(config-if)#standby 1 timers 4 12                 配置hello消息的计时器
r2(config-if)#end
r2#show standby
Ethernet0/0 - Group 1
  State is Active
    2 state changes, last state change 00:12:27
  Virtual IP address is 192.168.1.100
  Active virtual MAC address is 0000.0c07.ac01
    Local virtual MAC address is 0000.0c07.ac01 (v1 default)
  Hello time 4 sec, hold time 12 sec                     配置后的计时器
    Next hello sent in 3.060 secs
  Preemption enabled
  Active router is local
  Standby router is 192.168.1.1, priority 110 (expires in 8.100 sec)
  Priority 120 (configured 120)
  IP redundancy name is "hsrp-Et0/0-1" (default)
 
4. 配置端口跟踪:利用端口跟踪,活跃路由器的优先级可以基于路由器端口的可用性而自动调整,当活跃路由器的上一个跟踪变为不可用时,活跃路由器的HSRP优先级将被降低。此时即使备份路由器的优先级高于活跃路由器也不能自动变为活跃路由器,须在在备份路由器上配置占先权才行.
R2
r2(config)#int e0/0
r2(config-if)#standby 1 track e0/1 50             配置端口追踪,追踪端口为R2e0/1
r2(config-if)#standby 1 preempt                              为其配置占先权,在其回复后抢回原有地位
r2(config-if)#^Z
r2#
*Mar  1 00:48:27.619: %SYS-5-CONFIG_I: Configured from console by console
r2#show standby
Ethernet0/0 - Group 1
  State is Active
    2 state changes, last state change 00:15:54
  Virtual IP address is 192.168.1.100
  Active virtual MAC address is 0000.0c07.ac01
    Local virtual MAC address is 0000.0c07.ac01 (v1 default)
  Hello time 4 sec, hold time 12 sec
    Next hello sent in 0.464 secs
  Preemption enabled                                          已启用占先权
  Active router is local
  Standby router is 192.168.1.1, priority 110 (expires in 9.536 sec)
  Priority 120 (configured 120)
    Track interface Ethernet0/1 state Up decrement 50    当其上行链路不可用时,其优先级自动减去50
  IP redundancy name is "hsrp-Et0/0-1" (default)
Ethernet0/1 - Group 2
  State is Standby
    1 state change, last state change 00:29:57
  Virtual IP address is 192.168.2.200
  Active virtual MAC address is 0000.0c07.ac02
    Local virtual MAC address is 0000.0c07.ac02 (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 2.956 secs
  Preemption disabled
  Active router is 192.168.2.1, priority 110 (expires in 9.268 sec)
  Standby router is local
  Priority 120 (configured 120)
  IP redundancy name is "hsrp-Et0/1-2" (default)
r2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
r2(config)#int e0/1
r2(config-if)#shutdown                                       关闭R2e0/1
r2(config-if)#
*Mar  1 00:49:23.503: %HSRP-5-STATECHANGE: Ethernet0/1 Grp 2 state Standby -> Init
*Mar  1 00:49:25.503: %LINK-5-CHANGED: Interface Ethernet0/1, changed state to administratively down
 
*Mar  1 00:49:26.503: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/1, changed state to
down
 
R1
r1(config)#int e0/0
r1(config-if)#standby 1 preempt            备份路由器发生政变,并取得后的路由器地位
r1(config-if)#
*Mar  1 00:52:29.431: %HSRP-5-STATECHANGE: Ethernet0/0 Grp 1 state Standby -> Active
r1(config-if)#do show standby
Ethernet0/0 - Group 1
  State is Active
    5 state changes, last state change 00:00:37
  Virtual IP address is 192.168.1.100
  Active virtual MAC address is 0000.0c07.ac01
    Local virtual MAC address is 0000.0c07.ac01 (v1 default)
  Hello time 4 sec, hold time 12 sec
    Next hello sent in 3.184 secs
  Preemption enabled
  Active router is local
  Standby router is 192.168.1.2, priority 70 (expires in 11.116 sec)              R2的优先级变为70
  Priority 110 (configured 110)
  IP redundancy name is "hsrp-Et0/0-1" (default)
 
R1
r1#debug standby                                   开启调试功能,查看其选举过程
HSRP debugging is on
4.1在开启调试功能的同时将被关闭的端口激活
r2(config)#int e0/1
r2(config-if)#no shu                                         激活被down掉的端口
r2(config-if)#
*Mar  1 00:56:19.583: %LINK-3-UPDOWN: Interface Ethernet0/1, changed state to up
*Mar  1 00:56:19.915: %HSRP-5-STATECHANGE: Ethernet0/0 Grp 1 state Standby -> Active
*Mar  1 00:56:20.583: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/1, changed state to
up
r2(config-if)#^Z
r2#
*Mar  1 00:56:38.111: %SYS-5-CONFIG_I: Configured from console by console
*Mar  1 00:56:38.583: %HSRP-5-STATECHANGE: Ethernet0/1 Grp 2 state Speak -> Standby
r2#show standby
Ethernet0/0 - Group 1
  State is Active
    5 state changes, last state change 00:00:41
  Virtual IP address is 192.168.1.100
  Active virtual MAC address is 0000.0c07.ac01
    Local virtual MAC address is 0000.0c07.ac01 (v1 default)
  Hello time 4 sec, hold time 12 sec
    Next hello sent in 2.984 secs
  Preemption enabled
  Active router is local                              R2重新变为活动路由器地位
  Standby router is 192.168.1.1, priority 110 (expires in 11.320 sec)
  Priority 120 (configured 120)
    Track interface Ethernet0/1 state Up decrement 50
  IP redundancy name is "hsrp-Et0/0-1" (default)
Ethernet0/1 - Group 2
  State is Standby
    3 state changes, last state change 00:00:22
  Virtual IP address is 192.168.2.200
  Active virtual MAC address is 0000.0c07.ac02
    Local virtual MAC address is 0000.0c07.ac02 (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 1.632 secs
  Preemption disabled
  Active router is 192.168.2.1, priority 110 (expires in 7.504 sec)
  Standby router is local
  Priority 120 (configured 120)
  IP redundancy name is "hsrp-Et0/1-2" (default)
r2#
4.2查看调试过程
r1#
*Mar  1 00:56:16.043: HSRP: Et0/1 Grp 2 Hello  out 192.168.2.1 Active  pri 110 vIP 192.168.2.200
*Mar  1 00:56:16.603: HSRP: Et0/1 REDIRECT adv in, Passive, active 0, passive 1, from 192.168.2.2
*Mar  1 00:56:17.675: HSRP: Et0/0 Grp 1 Hello  in  192.168.1.2 Standby pri 120 vIP 192.168.1.100
*Mar  1 00:56:17.819: HSRP: Et0/0 Grp 1 Hello  out 192.168.1.1 Active  pri 110 vIP 192.168.1.100
*Mar  1 00:56:17.979: HSRP: Et0/0 REDIRECT adv in, Active, active 1, passive 2, from 192.168.1.2
*Mar  1 00:56:18.051: HSRP: Et0/0 API arp proto filter, 0000.0c07.ac01 is active vMAC for grp 1 - fi
lter
*Mar  1 00:56:18.055: HSRP: Et0/0 Grp 1 Coup   in  192.168.1.2 Standby pri 120 vIP 192.168.1.100
*Mar  1 00:56:18.055: HSRP: Et0/0 Grp 1 Active: j/Coup rcvd from higher pri router (120/192.168.1.2)
 
*Mar  1 00:56:18.055: HSRP: Et0/0 Grp 1 Active router is 192.168.1.2, was local
*Mar  1 00:56:18.059: HSRP: Et0/0 Grp 1 Standby router is unknown, was 192.168.1.2
*Mar  1 00:56:18.059: HSRP: Et0/0 Grp 1 Active -> Speak
*Mar  1 00:56:18.059: %HSRP-5-STATECHANGE: Ethernet0/0 Grp 1 state Active -> Speak
*Mar  1 00:56:18.059: HSRP: Et0/0 Grp 1 Redundancy "hsrp-Et0/0-1" state Active -> Speak
*Mar  1 00:56:18.063: HSRP: Et0/0 Redirect adv out, Passive, active 0 passive 1
*Mar  1 00:56:18.067: HSRP: Et0/0 API MAC address update
*Mar  1 00:56:18.071: HSRP: Et0/0 Grp 1 Hello  out 192.168.1.1 Speak   pri 110 vIP 192.168.1.100
*Mar  1 00:56:18.071: HSRP: Et0/0 REDIRECT adv in, Active, active 1, passive 1, from 192.168.1.2
*Mar  1 00:56:18.071: HSRP: Et0/0 Grp 1 Hello  in  192.168.1.2 Active  pri 120 vIP 192.168.1.100
*Mar  1 00:56:19.043: HSRP: Et0/1 Grp 2 Hello  out 192.168.2.1 Active  pri 110 vIP 192.168.2.200
*Mar  1 00:56:21.931: HSRP: Et0/0 Grp 1 Hello  in  192.168.1.2 Active  pri 120 vIP 192.168.1.100
*Mar  1 00:56:22.043: HSRP: Et0/1 Grp 2 Hello  out 192.168.2.1 Active  pri 110 vIP 192.168.2.200
*Mar  1 00:56:22.071: HSRP: Et0/0 Grp 1 Hello  out 192.168.1.1 Speak   pri 110 vIP 192.168.1.100
*Mar  1 00:56:25.043: HSRP: Et0/1 Grp 2 Hello  out 192.168.2.1 Active  pri 110 vIP 192.168.2.200
*Mar  1 00:56:25.931: HSRP: Et0/0 Grp 1 Hello  in  192.168.1.2 Active  pri 120 vIP 192.168.1.100
*Mar  1 00:56:26.071: HSRP: Et0/0 Grp 1 Hello  out 192.168.1.1 Speak   pri 110 vIP 192.168.1.100
*Mar  1 00:56:26.587: HSRP: Et0/1 Grp 2 Hello  in  192.168.2.2 Speak   pri 120 vIP 192.168.2.200
*Mar  1 00:56:28.043: HSRP: Et0/1 Grp 2 Hello  out 192.168.2.1 Active  pri 110 vIP 192.168.2.200
*Mar  1 00:56:29.587: HSRP: Et0/1 Grp 2 Hello  in  192.168.2.2 Speak   pri 120 vIP 192.168.2.200
*Mar  1 00:56:29.931: HSRP: Et0/0 Grp 1 Hello  in  192.168.1.2 Active  pri 120 vIP 192.168.1.100
*Mar  1 00:56:30.055: HSRP: Et0/0 Grp 1 Speak: d/Standby timer expired (unknown)
*Mar  1 00:56:30.055: HSRP: Et0/0 Grp 1 Standby router is local
*Mar  1 00:56:30.055: HSRP: Et0/0 Grp 1 Speak -> Standby
*Mar  1 00:56:30.055: %HSRP-5-STATECHANGE: Ethernet0/0 Grp 1 state Speak -> Standby
*Mar  1 00:56:30.059: HSRP: Et0/0 Grp 1 Redundancy "hsrp-Et0/0-1" state Speak -> Standby
*Mar  1 00:56:30.059: HSRP: Et0/0 Grp 1 Hello  out 192.168.1.1 Standby pri 110 vIP 192.168.1.100
*Mar  1 00:56:31.043: HSRP: Et0/1 Grp 2 Hello  out 192.168.2.1 Active  pri 110 vIP 192.168.2.200
*Mar  1 00:56:32.603: HSRP: Et0/1 Grp 2 Hello  in  192.168.2.2 Speak   pri 120 vIP 192.168.2.200
*Mar  1 00:56:33.963: HSRP: Et0/0 Grp 1 Hello  in  192.168.1.2 Active  pri 120 vIP 192.168.1.100
*Mar  1 00:56:34.043: HSRP: Et0/1 Grp 2 Hello  out 192.168.2.1 Active  pri 110 vIP 192.168.2.200
*Mar  1 00:56:34.059: HSRP: Et0/0 Grp 1 Hello  out 192.168.1.1 Standby pri 110 vIP 192.168.1.100
 
4.3 使用no debug all no debug standby 关闭调试功能。此功能消耗大量的路由器资源,所以用完后应及时关闭,强烈建议:在路由器资源使用很大或是路由器负担很重的情况不要开启该功能。
r1#no debug all
*Mar  1 00:57:30.011: HSRP: Et0/0 Grp 1 Hello  in  192.168.1.2 Active  pri 120 vIP 192.168.1.100
*Mar  1 00:57:30.059: HSRP: Et0/0 Grp 1 Hello  out 192.168.1.1 Standby pri 110 vIP 192.168.1.100
*Mar  1 00:57:30.635: HSRP: Et0/1 Grp 2 Hello  in  192.168.2.2 Standby pri 120 vIP 192.168.2.200
All possible debugging has been turned off
r1#
5.配置完毕,检测全网是否互通。
VPCS 3 >ping 192.168.1.3
192.168.1.3 icmp_seq=1 time=78.000 ms
192.168.1.3 icmp_seq=2 time=109.000 ms
192.168.1.3 icmp_seq=3 time=125.000 ms
192.168.1.3 icmp_seq=4 time=125.000 ms
192.168.1.3 icmp_seq=5 time=93.000 ms
 
VPCS 3 >ping 192.168.1.4
192.168.1.4 icmp_seq=1 time=79.000 ms
192.168.1.4 icmp_seq=2 time=63.000 ms
192.168.1.4 icmp_seq=3 time=47.000 ms
192.168.1.4 icmp_seq=4 time=47.000 ms
192.168.1.4 icmp_seq=5 time=156.000 ms
总结和分析:
1.        HSRP不仅可以实现网关的备份,实现动态的网关,还可以起到负载的功能。
2.        HSRP组包含活动路由器、备份路由器、虚拟路由器和其他路由器。一个HSRP组中有且只有一个为活动路由器,并负责转发数据,一个路由器的多个端口不能属于一个HSRP组。
3.        利用端口跟踪,活跃路由器的优先级可以基于路由器端口的可用性而自动调整,当活跃路由器的上一个跟踪变为不可用时,活跃路由器的HSRP优先级将被降低。此时即使备份路由器的优先级高于活跃路由器也不能自动变为活跃路由器,须在在备份路由器上配置占先权才行.