如何配置HSRP |
| 来源:转载 (2006-06-22 11:30:43) |
|
如何配置HSRP? 你可以在路由器的接口配置模式使用standby命令完成几乎所有HSRP配置。让我们考虑在配置图表中显示的网络所采用的步骤。
对于路由器1:
1.配置以太网接口上的IP地址 2.配置备用IP地址 3.配置备用抢先(通过抢先,只要路由器1可用,将总是主路由器。)
对于路由器2:
1.配置以太网接口上的IP地址 2.配置备用IP地址 3.配置备用优先小于100(在本例中,是99。)
现在,我们考虑样例网络的配置。
路由器 1
(show running-config output) interface Ethernet0/0 ip address 10.1.1.1 255.255.255.0 standby ip 10.1.1.3 standby preempt
Router1# show standby Ethernet0/0 - Group 0 State is Active 2 state changes, last state change 00:00:29 Virtual IP address is 10.1.1.3 Active virtual MAC address is 0000.0c07.ac00 Local virtual MAC address is 0000.0c07.ac00 (default) Hello time 3 sec, hold time 10 sec Next hello sent in 0.692 secs Preemption enabled Active router is local Standby router is 10.1.1.2, priority 99 (expires in 8.097 sec) Priority 100 (default 100) IP redundancy name is "hsrp-Et0/0-0" (default)
Router1#
路由器 2
(show running-config output) interface Ethernet0/0 ip address 10.1.1.2 255.255.255.0 standby ip 10.1.1.3 standby priority 99
Router2# show standby Ethernet0/0 - Group 0 Local state is Standby, priority 99 Hellotime 3 sec, holdtime 10 sec Next hello sent in 1.014 Virtual IP address is 10.1.1.3 configured Active router is 10.1.1.1, priority 100 expires in 7.159 Standby router is local 4 state changes, last state change 00:02:02
Router2#
当在特权模式时,可以使用show standby命令查看HSRP状态。这条命令会告诉哪个路由器是活动的,哪个是备份的,以及许多其他统计信息。
在PC上,缺省IP地址应该指向10.1.1.3,而不是路由器中的一个。这样,如果某台路由器出现故障,另一台将接管。而且甚至能够利用这个冗 余在白天将活动路由器关闭,因为HSRP故障备份替换时间少于10秒。
HSRP是一个保证高可用性和路由器冗余的有用工具。当然,也有几个HSRP选项我们没有在本文中详细说明。要获得更多信息,请查看Cisco HSRP FAQ。
(http://www.fanqiang.com)
|
|