【HSRP简介】
热待机路由协议的目的就是希望能在网络内提供趋于100%的数据转发能力,尽量保证在路由器出现故障的情况下,继续发往该路由器的数据包不会丢失,能够自动由其它路由器发送出去。
这是通过一个虚拟的路由器来实现的。子网内的主机以该虚拟路由器作为缺省网关并向其发送数据,而各个启动了HSRP的路由器通过竞争来担当该虚拟路由器的角色并负责这些数据的转发。负责转发发向虚拟路由器的数据包的那台路由器为Active状态,其它一个或多个路由器作为Standby状态。当Active路由器失效时,Standby路由器通过与Active路由器的信息交互和计时器来自动取缔原来的路由器,将自身变为Active,继续负责发往虚拟路由器的数据转发工作。然而,对用户来说,这种网络的变化是透明的,亦即可以达到一种。
【实验拓扑】
(点击图片查看完整大图) 
各个路由器之间运行RIP协议
PC的默认网关为192.168.1.1 ,也就是我们虚拟出来的网关为192.168.1.1
【配置步骤】
Internet
Router>enable
Router#conf terminal
//路由器基础配置
Router(config)#no ip domain-lookup
Router(config)#hostname Internet
Internet(config)#line con 0
Internet(config-line)#exec-timeout 0 0
Internet(config-line)#logging synchronous
Internet(config-line)#end
Internet#
Internet#conf t
// 配置路由器各个接口的IP地址
Internet(config)#int e0/0
Internet(config-if)#ip address 192.168.2.1 255.255.255.0
Internet(config-if)#no sh
Internet(config-if)#exit
Internet(config)#int e0/1
Internet(config-if)#ip address 192.168.3.1 255.255.255.0
Internet(config-if)#no sh
Internet(config-if)#exit
Internet(config)#int lo0
Internet(config-if)#ip address 100.1.1.1 255.255.255.0
Internet(config-if)#no sh
Internet(config-if)#exit
//启用RIP路由协议
Internet(config)#router rip
Internet(config-router)#version 2
Internet(config-router)#no auto-summary
Internet(config-router)#network 192.168.2.0
Internet(config-router)#network 192.168.3.0
Internet(config-router)#network 100.1.1.0
Internet(config-router)#end
Internet#write
Building configuration...
Internet#
R1
Router>enable
//路由器基础配置
Router(config)#no ip domain-lookup
Router(config)#hostname R1
R1(config)#line con 0
R1(config-line)#exec-timeout 0 0
R1(config-line)#logging synchronous
R1(config-line)#end
R1#conf t
//配置接口IP地址
R1(config)#int e0/0
R1(config-if)#ip address 192.168.2.2 255.255.255.0
R1(config-if)#no sh
R1(config-if)#int e0/1
R1(config-if)#ip address 192.168.1.2 255.255.255.0
R1(config-if)#no sh
R1(config-if)#exit
//启用RIP路由协议
R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#no auto-summary
R1(config-router)#network 192.168.2.0
R1(config-router)#network 192.168.1.0
R1(config-router)#end
R1#write
//配置HSRP
R1(config)#int e0/1 
R1(config-if)#standby 1 ip 192.168.1.1
R1(config-if)#end
//查看standby信息
R1#show standby
Ethernet0/1 - Group 1
  State is Standby   //状态为备份状态
3 state changes, last state change 00:06:32
  Virtual IP address is 192.168.1.1  //虚拟出来的IP地址
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.992 secs
Preemption disabled
Active router is 192.168.1.3, priority 100 (expires in 7.892 sec)
Standby router is local
Priority 100 (default 100)
IP redundancy name is "hsrp-Et0/1-1" (default)
R1#
R2
Router>enable
Router#conf t
//路由器基本配置
Router(config)#no ip domain-lookup
Router(config)#hostname R2
R2(config)#line con 0
R2(config-line)#exec-timeout 0 0
R2(config-line)#logging synchronous
R2(config-line)#end
R2#conf t
//配置路由器接口IP
R2(config)#int e0/0
R2(config-if)#ip address 192.168.3.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#int e0/1
R2(config-if)#ip address 192.168.1.3 255.255.255.0
R2(config-if)#no sh
R2(config-if)#exit
//启用RIP路由协议
R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#no auto-summary
R2(config-router)#network 192.168.3.0
R2(config-router)#network 192.168.1.0
R2(config-router)#end
R2#write
R2#conf t
//配置HSRP
R2(config)#int e0/1
R2(config-if)#standby 1 ip 192.168.1.1
//查看Standby信息
R2#show standby
Ethernet0/1 - Group 1
State is Active  //状态为活动状态
2 state changes, last state change 00:06:11
  Virtual IP address is 192.168.1.1  //虚拟出来的IP地址
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.148 secs
Preemption disabled
Active router is local
Standby router is 192.168.1.2, priority 100 (expires in 7.316 sec)
Priority 100 (default 100)
IP redundancy name is "hsrp-Et0/1-1" (default)
R2#
【测试】
HSRP的目的是提高系统的可靠性,我们关掉一个端口,模拟网络出现故障,来看一下能否正常通信。关掉之前我们先来测试一下PC到100.1.1.1之间能否正常通信
 
现在我们断开R2的E0/1,因为刚才的R2是active,也就是我们的数据是从R2经过的。
R2(config)#int e0/1
R2(config-if)#shu
R2(config-if)#shutdown 
观察一下standby的信息
R1#show standby
Ethernet0/1 - Group 1
  State is Active //状态由standby转换为active
4 state changes, last state change 00:00:22
  Virtual IP address is 192.168.1.1
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 1.068 secs
Preemption disabled
Active router is local
Standby router is unknown
Priority 100 (default 100)
IP redundancy name is "hsrp-Et0/1-1" (default)
R1#
再次用PC去Ping 100.1.1.1
C:\Users\Five>ping 100.1.1.1
正在 Ping 100.1.1.1 具有 32 字节的数据:
来自 100.1.1.1 的回复: 字节=32 时间=95ms TTL=254
来自 100.1.1.1 的回复: 字节=32 时间=63ms TTL=254
来自 100.1.1.1 的回复: 字节=32 时间=79ms TTL=254
来自 100.1.1.1 的回复: 字节=32 时间=125ms TTL=254
100.1.1.1 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 63ms,最长 = 125ms,平均 = 90ms
C:\Users\Five>
发现依然可以Ping通,也就是说,系统自动为我们转换了网关,但是整个过程对用户来说确实透明的。这就是HSRP最大的好处。管理员可以及时修复出故障的端口,而不影响网络的正常运行。
本文转自 Jhuster 51CTO博客,原文链接:http://blog.51cto.com/xwnet/170056,如需转载请自行联系原作者

HSRP热备份路由协议配置详解相关推荐

  1. keepalived介绍、安装及配置详解

    文章目录 keepalived简介 keeplived和LVS关系 VRRP工作原理 keepalived体系结构及工作原理 keepalived安装 keepalived配置详解 keepalive ...

  2. 【网络安全】BGP线路是什么意思?最全BGP路由协议技术详解

    [网络安全]BGP线路是什么意思?最全BGP路由协议技术详解 一.BGP 的基本概念 自治系统AS(Autonomous System) AS 是指在一个实体管辖下的拥有相同选路策略的 IP 网络.B ...

  3. elasticsearch-.yml(中文配置详解)

    此elasticsearch-.yml配置文件,是在$ES_HOME/config/下 elasticsearch-.yml(中文配置详解) # ======================== El ...

  4. (ASA) Cisco Web ××× 配置详解 [三部曲之一]

    (ASA) Cisco Web ××× 配置详解 [三部曲之一] 注意:本文仅对Web×××特性和配置作介绍,不包含SSL ×××配置,SSL ×××配置将在本版的后续文章中进行介绍.   首先,先来 ...

  5. mybatis 同名方法_MyBatis(四):xml配置详解

    目录 1.我们将 数据库的配置语句写在 db.properties 文件中 2.在 mybatis-configuration.xml 中加载db.properties文件并读取 通过源码我们可以分析 ...

  6. logback节点配置详解

    logback节点配置详解 一:根节点 <configuration></configuration> 属性 : debug : 默认为false ,设置为true时,将打印出 ...

  7. PM配置详解之一:企业结构

    1.维护计划工厂 功能说明 在公司结构中定义维护工厂(通常已经作为后勤工厂存在)和维护计划工厂(简称计划工厂). 维护工厂:设备所安装的位置,如某机组安装在合营公司,那么合营公司就是此机组的维护工厂, ...

  8. 转 Log4j.properties配置详解

    一.Log4j简介 Log4j有三个主要的组件:Loggers(记录器),Appenders (输出源)和Layouts(布局).这里可简单理解为日志类别,日志要输出的地方和日志以何种形式输出.综合使 ...

  9. Iptables防火墙配置详解

    iptables防火墙配置详解 iptables简介 iptables是基于内核的防火墙,功能非常强大,iptables内置了filter,nat和mangle三张表. (1)filter表负责过滤数 ...

  10. spring之旅第四篇-注解配置详解

    spring之旅第四篇-注解配置详解 一.引言 最近因为找工作,导致很长时间没有更新,找工作的时候你会明白浪费的时间后面都是要还的,现在的每一点努力,将来也会给你回报的,但行好事,莫问前程!努力总不会 ...

最新文章

  1. 工作休息之余的生活乐趣
  2. 增加数据_Photoshop XMP元数据沉积造成文件量增加
  3. 八进制数输出二进制c语言,C语言 某数输出二进制的某位
  4. mysql查询语句习题._MySql数据库基本select查询语句练习题,初学者易懂。
  5. thinkphp5 图片压缩旋转_【好工具】在线免费无限制的PDF处理工具(转换、编辑、分割、合并、压缩)...
  6. 【转载】用Delphi实现程序间的数据传递
  7. python中的pymysql_(转)Python中操作mysql的pymysql模块详解
  8. django与grpc融合的过程
  9. 动画效果-基础动画设置(改变大小,改变透明度,翻转,旋转,复原)
  10. python中把输出结果写到一个文件中_如何将脚本输出写入文件和命令行?
  11. Qt C++连接MySQL教程,解决QSqlDatabase:QMySQL driver not loaded
  12. 系统动力学Vensim的使用
  13. 汽车零配件行业MES系统,你了解多少?
  14. 计算机辅助设计和辅助制造简称,计算机辅助设计与制造
  15. Python爬虫系列之全国邮编区号爬取
  16. 深入理解Plasma(四)Plasma Cash
  17. model.generate返回句子大于1时出现<unk>的情况处理
  18. 递推与递归 (区别)
  19. API网关-Gateway
  20. 制作一个惊艳所有人的计算器

热门文章

  1. atitit 未来学课程体系.docx
  2. Atitit ide之道 开发工具之道 attilax著 v2 s22.docx Atitit ide开发工具之道 attilax总结 1. 代码编辑器功能 3 1.1. 关键词颜色 3 1.2.
  3. Atitit 理解Monad attilax总结Atiti
  4. Atitit eclipse新特性总结3.1---4.4  4.5
  5. atitit.javascript调用java in swt attilax 总结
  6. paip.ikanalyzer 重加载词库的方法.
  7. 如何评价路孚特的Datastream工具?
  8. 华夏基金:养老是基金业下一个20年最大风口
  9. KK集团完成门店系统一期上云
  10. 阿里云郑晓:浅谈GPU虚拟化技术(第三章)