HSRP:热备份路由器协议(HSRP:Hot Standby Router Protocol),是cisco平台一种特有的技术,是cisco的私有协议。
该协议中含有多台路由器,对应一个HSRP组。该组中只有一个路由器承担转发用户流量的职责,这就是活动路由器。当活动路由器失效后,备份路由器将承担该职责,成为新的活动路由器。这就是热备份的原理。百度百科
备份的是网关。
两台PC IP配置
两个网关配置IP+开启端口
R1-GW
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ho R1-GW
R1-GW(config)#
R1-GW(config)#
R1-GW(config)#int f0/0
R1-GW(config-if)#ip add 192.168.1.252 255.255.255.0
R1-GW(config-if)#no shut
R1-GW(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1-GW(config-if)#exit
R1-GW(config)#int f0/1
R1-GW(config-if)#ip add 10.1.1.1 255.255.255.0
R1-GW(config-if)#no shut
R1-GW(config-if)#exit
R1-GW(config)#do show ip int b
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 192.168.1.252 YES manual up up
FastEthernet0/1 10.1.1.1 YES manual up up
Vlan1 unassigned YES unset administratively down down
R2-GW
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ho R2-GW
R2-GW(config)#int f0/0
R2-GW(config-if)#ip add 192.168.1.253 255.255.255.0
R2-GW(config-if)#no shut
R2-GW(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R2-GW(config-if)#
R2-GW(config-if)#exit
R2-GW(config)#int f0/1
R2-GW(config-if)#ip add 20.1.1.1 255.255.255.0
R2-GW(config-if)#no shut
R2-GW(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
R2-GW(config-if)#exit
R2-GW(config)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
R2-GW(config)#
R2-GW(config)#do show ip int b
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 192.168.1.253 YES manual up up
FastEthernet0/1 20.1.1.1 YES manual up up
Vlan1 unassigned YES unset administratively down down
R-waiwang
Router>
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ho R-waiwang
R-waiwang(config)#int f0/0
R-waiwang(config-if)#ip add 10.1.1.2 255.255.255.0
R-waiwang(config-if)#no shut
R-waiwang(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R-waiwang(config-if)#exit
R-waiwang(config)#int f0/1
R-waiwang(config-if)#ip add 20.1.1.2 255.255.255.0
R-waiwang(config-if)#no shut
R-waiwang(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
R-waiwang(config-if)#exit
R-waiwang(config)#int f0/3
%Invalid interface type and number
R-waiwang(config)#int f1/0
R-waiwang(config-if)#ip add 30.1.1.254 255.255.255.0
R-waiwang(config-if)#no shut
R-waiwang(config-if)#
%LINK-5-CHANGED: Interface FastEthernet1/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up
R-waiwang(config-if)#exit
R-waiwang(config)#do show ip int b
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 10.1.1.2 YES manual up up
FastEthernet0/1 20.1.1.2 YES manual up up
FastEthernet1/0 30.1.1.254 YES manual up up
FastEthernet1/1 unassigned YES unset administratively down down
Vlan1 unassigned YES unset administratively down down
外网PC
R1-GW
R1-GW(config)#ip route 0.0.0.0 0.0.0.0 10.1.1.2
R2-GW
R1-GW(config)#ip route 0.0.0.0 0.0.0.0 20.1.1.2
R-waiwang
为了体现实验,我们如果将R1接口down掉,PC可以使用备份路由上网,所以我们要将外网路由的下一跳IP指向R2的F0/1的IP
R-waiwang(config)#ip route 0.0.0.0 0.0.0.0 20.1.1.1
R-waiwang(config)#do show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is 20.1.1.1 to network 0.0.0.0
10.0.0.0/24 is subnetted, 1 subnets
C 10.1.1.0 is directly connected, FastEthernet0/0
20.0.0.0/24 is subnetted, 1 subnets
C 20.1.1.0 is directly connected, FastEthernet0/1
30.0.0.0/24 is subnetted, 1 subnets
C 30.1.1.0 is directly connected, FastEthernet1/0
S* 0.0.0.0/0 [1/0] via 20.1.1.1
R1-活跃路由器
R1-GW(config)#int f0/0
R1-GW(config-if)#standby 1 ip 192.168.1.254 创建热备份组号为1,虚拟网关IP为192.168.1.254
%HSRP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Speak -> Standby
%HSRP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Standby -> Active
R1-GW(config-if)#standby 1 priority 200 设置优先级为200
R1-GW(config-if)#standby 1 preempt 设置占先权
R1-GW(config-if)#standby 1 track f0/1 跟踪f0/1接口
查看热备份配置信息
R1-GW#show standby brief
P indicates configured to preempt.
|
Interface Grp Pri P State Active Standby Virtual IP
Fa0/0 1 200 Active local 192.168.1.253 192.168.1.254
R2-备份路由器
R2-GW(config)#int f0/0
R2-GW(config-if)#standby 1 ip 192.168.1.254
R2-GW(config-if)#standby 1 priority
%HSRP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Speak -> Standby
R2-GW(config-if)#standby 1 priority 195
R2-GW(config-if)#standby 1 preempt
查看热备份配置信息
R2-GW#show standby brief
P indicates configured to preempt.
|
Interface Grp Pri P State Active Standby Virtual IP
Fa0/0 1 195 P Standby 192.168.1.252 local 192.168.1.254
R2-GW#
我们进入活跃路由器将网关接口f0/0,down掉,备份路由器每隔一段时间会与活跃路由器进行通信(检测端口是否正常),当检测到活跃路由器异常时会自动升级为活跃路由器,如果活跃路由器的故障修复重新启动,那么会重新接管活跃路由器的身份,备份路由器会自动降级。
也就是说活跃路由器故障那么会由备份路由器接管,故障修复后备份路由器会回到原来的位置。
备份路由器的身份转变取决于活跃路由器是否出现异常。
C:\>ping -t 30.1.1.1
Pinging 30.1.1.1 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Reply from 30.1.1.1: bytes=32 time=15ms TTL=126
Reply from 30.1.1.1: bytes=32 time<1ms TTL=126
Reply from 30.1.1.1: bytes=32 time=12ms TTL=126
Reply from 30.1.1.1: bytes=32 time<1ms TTL=126
Reply from 30.1.1.1: bytes=32 time<1ms TTL=126
Reply from 30.1.1.1: bytes=32 time<1ms TTL=126
Request timed out.
Request timed out.
Reply from 30.1.1.1: bytes=32 time<1ms TTL=126
Reply from 30.1.1.1: bytes=32 time=1ms TTL=126
Reply from 30.1.1.1: bytes=32 time<1ms TTL=126
Reply from 30.1.1.1: bytes=32 time=1ms TTL=126
Reply from 30.1.1.1: bytes=32 time<1ms TTL=126
Reply from 30.1.1.1: bytes=32 time=1ms TTL=126
Reply from 30.1.1.1: bytes=32 time=1ms TTL=126
将f0/1接口down掉
查看活跃路由器的热备份信息
R1-GW#sh standby brief
P indicates configured to preempt.
|
Interface Grp Pri P State Active Standby Virtual IP
Fa0/0 1 190 Standby 192.168.1.253 local 192.168.1.254
R1-GW#sh standby
FastEthernet0/0 - Group 1
State is Standby
16 state changes, last state change 03:33:02
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.035 secs
Preemption disabled
Active router is 192.168.1.253, priority 195 (expires in 9 sec)
MAC address is 0000.0C07.AC01
Standby router is local
Priority 190 (configured 200)
Track interface FastEthernet0/1 state Down decrement 10
Group name is hsrp-Fa0/0-1 (default)
R1-GW#
查看备份路由器的热备份信息
R2-GW#sh standby brief
P indicates configured to preempt.
|
Interface Grp Pri P State Active Standby Virtual IP
Fa0/0 1 195 P Active local 192.168.1.252 192.168.1.254
R2-GW#
自然场景文字是图像高层语义的一种重要载体,近些年自然场景图像中的文本检测与识别技术越来越引起人们的重视。特别是近年来ICDAR的历界比赛,更是逐渐将这一领域的score不断提升。如http://rrc.cvc.uab.es/?ch=4&com=evaluation&task=1>v=1这个主页上看到列出的result结果,都有达到90%多的。此外,一些大公司的AI都提供了这样的接口,如百度AI
1月,索尼宣布拥抱造车时,日经中文网评论认为,索尼汽车的假想敌可能是元宇宙。这有其道理,扎克伯格此前介绍元宇宙时说:“(人们)可以把更多时间花在重要的事情上,用在路上的时间减少。”这当然就包括汽车出行,但似乎这是车企更应该担心的问题——用于出行的纯电动汽车和导致人们出行减少的元宇宙。不容忽视的是,在过去的一年里,包括智己汽车、蔚来、宝马等品牌在内,汽车行业或多或少地和元宇宙这个概念产生了一些交集。然而,汽车作为现代人的第二个家,要如何驾驭一个平行的世界?汽车X元宇宙,是一场难分敌友的博弈,还是一次合力进
在dataframe中根据一定的条件,得到符合要求的某行元素所在的位置。代码如下所示:df = pd.DataFrame({'BoolCol': [1, 2, 3, 3, 4],'attr': [22, 33, 22, 44, 66]}, index=[10,20,30,40,50])print(df)a = df[(df.BoolCol==3)&amp;(df.a...
C++ format 函数C++编程Format是一个很常用,却又似乎很烦的方法,以下是它的完整概貌,以供大家查询之用:一、字符串首先看它的声明:function Format(const Format: string; const Args: array of const): string; overload;事实上Format方法有两个种形式,另外一种是三个参数
1、如何查看话题的发布频率在使用ROS的时候经常会用到话题,每个话题都有自己的频率。如何查看一个话题的频率,可以通过rqt工具来进行查看rosrun rqt_topic rqt_topic 会得到如下信息右侧的Hz里面显示的就是话题的发布频率了。2、如何查看一段ROS代码的运行时间在ROS的运行过程中,始终存在一个时间戳,这个时间戳可以用来查看代码的运行时间:ros::Time start = ros::Time::now();cout << start << e
↑№☆我贴了外膜,貌似不贴外模更漂亮 √↑№☆再来一张,acer v3-571G A面是黑色的,再加上是15.6英寸的屏幕,感觉看起来很宽大√↑№☆背面17颗螺丝(黑色) + 电源处3颗(白色) 全拆下来,拆前一定记得把电池卸下 √↑№☆ 卸下圆圈处的螺丝 √↑№☆ 按箭头的方向将硬盘(有点紧注意力度)、内存(先下压再往两边
Oracle OCP 11G 051(61题版本)答案解析目录
参考:http://blog.csdn.net/qq_27435059/article/details/51493199
原方案:{ "keys":["f5"], "caption": "SublimeREPL: Python - RUN current file", "command": "run_existing_window_command", "args": {"id": "repl_python_run", "file": "config/Python/Main.sublime-me...
背景在使用pyqt5写一个软件,其中需要使用matplotlib的Ax3D绘制3D图像,并放置在一个widget中显示,却发现绘制的3D图像无法旋转,而将画图的函数单拿出来使用plt.show()显示时能正常旋转。查了很多网页都找不到,最后突发奇想试了一下倒解决了,这里记录一下。问题描述:下面是书上的写法,也是网上教程的大部分写法,属于是万恶之源了。 class MatplotlibWidget(FigureCanvas): def __init__(self, parent=Non.
一、安装Python环境及IDE1、详情 查看如下文章:https://blog.csdn.net/Eayonz/article/details/106469500(1)更新Python pip,以及展示selenium版本指令如下:python -m pip install --upgrade pippip show selenium(我这边的Firefox已经装了ide插件,若使用指令pip show selenium不能展示版本号,请查看网上Python pip安装selenium的方法步骤或