8-HSRP基本介绍实验 //GNS3模拟

一、实验拓扑:
8-HSRP基本介绍实验   //GNS3模拟
二、实验要求:
1、R1、R2、R3运行EIGRP 90;
2、R1、R2在接口f1/0下部署Standby 1,并设置192.168.10.254的主备网关;
3、实验目的:验证standby状态、邻居状态机
三、命令部署:

四、验证:
1、R2的优先级为200,R3的优先级为100
R2#show standby bri
P indicates configured to preempt.
|
Interface Grp Prio P State Active Standby Virtual IP
Fa1/0 1 200 Active local 192.168.10.252 192.168.10.254

R3#show standby brief
P indicates configured to preempt.
|
Interface Grp Prio P State Active Standby Virtual IP
Fa1/0 1 100 P Standby 192.168.10.253 local 192.168.10.254
结论:R2处于Active状态,R3处于Standby状态
2、R2接口down掉的时候:
R2(config)#int f1/0
R2(config-if)#shutdown
R2(config-if)#
*Mar 1 00:22:48.463: %HSRP-6-STATECHANGE: FastEthernet1/0 Grp 1 state Active -> Init

PC-1>ping 1.1.1.1 -c 20000
84 bytes from 1.1.1.1 icmp_seq=297 ttl=254 time=28.924 ms
1.1.1.1 icmp_seq=298 timeout
1.1.1.1 icmp_seq=299 timeout
1.1.1.1 icmp_seq=300 timeout
1.1.1.1 icmp_seq=301 timeout
1.1.1.1 icmp_seq=302 timeout
1.1.1.1 icmp_seq=303 timeout
84 bytes from 1.1.1.1 icmp_seq=304 ttl=254 time=27.893 ms
结论:R2会从Active变为Init状态,同时R3会有Coup政变和Resign辞职包,这里都是2个AD包
3、当R3优先级变为255时候:
R2#
Mar 1 00:06:12.259: %HSRP-6-STATECHANGE: FastEthernet1/0 Grp 1 state Active -> Speak
R2#
Mar 1 00:06:22.259: %HSRP-6-STATECHANGE: FastEthernet1/0 Grp 1 state Speak -> Standby
R2#show standby bri
P indicates configured to preempt.
|
Interface Grp Prio P State Active Standby Virtual IP
Fa1/0 1 200 Standby 192.168.10.252 local 192.168.10.254

R3(config-if)#
*Mar 1 00:06:02.251: %HSRP-6-STATECHANGE: FastEthernet1/0 Grp 1 state Standby -> Active
R3#show standby bri
P indicates configured to preempt.
|
Interface Grp Prio P State Active Standby Virtual IP
Fa1/0 1 255 P Active local 192.168.10.253 192.168.10.254
结论:R2从Active侦听到有更高的优先级,所以变为Speak,然后变为Standby
R3因为优先级最高,并且开启了抢占,从Standby变为Active
8-HSRP基本介绍实验   //GNS3模拟
8-HSRP基本介绍实验   //GNS3模拟

8-HSRP基本介绍实验   //GNS3模拟

转载于:https://blog.51cto.com/13856092/2137272

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,以下是一个简单的思科交换机 HSRP 实验。 首先,我们需要了解 HSRP基本概念。HSRP 是一种协议,可实现两台或多台路由器共享虚拟 IP 地址。这些路由器称为 HSRP 组,其中一台被选为活动路由器,另一台作为备份路由器。活动路由器负责转发数据包,而备份路由器则处于待机状态。如果活动路由器出现故障,则备份路由器会接替其工作,以确保网络的连通性。 现在,我们来配置两个交换机实现 HSRP。 首先,假设我们有两个交换机,它们的 IP 地址分别为 192.168.1.1 和 192.168.1.2。我们将它们的 GigabitEthernet0/1 接口连接在一起。 在交换机 1 上,输入以下命令: ``` interface GigabitEthernet0/1 ip address 192.168.1.1 255.255.255.0 standby 1 ip 192.168.1.254 standby 1 priority 120 standby 1 preempt ``` 上述命令的含义如下: - `interface GigabitEthernet0/1`:表示进入 GigabitEthernet0/1 接口的配置模式。 - `ip address 192.168.1.1 255.255.255.0`:为接口分配 IP 地址。 - `standby 1 ip 192.168.1.254`:设置虚拟 IP 地址为 192.168.1.254。 - `standby 1 priority 120`:设置优先级为 120。 - `standby 1 preempt`:启用抢占模式,以确保优先级高的路由器成为活动路由器。 在交换机 2 上,输入以下命令: ``` interface GigabitEthernet0/1 ip address 192.168.1.2 255.255.255.0 standby 1 ip 192.168.1.254 standby 1 priority 110 ``` 上述命令的含义如下: - `interface GigabitEthernet0/1`:表示进入 GigabitEthernet0/1 接口的配置模式。 - `ip address 192.168.1.2 255.255.255.0`:为接口分配 IP 地址。 - `standby 1 ip 192.168.1.254`:设置虚拟 IP 地址为 192.168.1.254。 - `standby 1 priority 110`:设置优先级为 110,低于交换机 1 的优先级。 现在,我们已经完成了 HSRP 的配置。通过 `show standby` 命令可以查看 HSRP 的状态信息。在交换机 1 上,输入命令 `show standby`,输出应该类似于以下内容: ``` GigabitEthernet0/1 - Group 1 State is Active 4 state changes, last state change 00:02:23 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 1.472 secs Preemption enabled Active router is local Standby router is 192.168.1.2, priority 110 (expires in 8.016 sec) Priority 120 (configured 120) Group name is "hsrp-GigabitEthernet0/1-1" (default) ``` 可以看到,交换机 1 的状态是 Active,它拥有虚拟 IP 地址 192.168.1.254,它的优先级为 120。备份路由器是交换机 2,它的优先级为 110。 在交换机 2 上,输入命令 `show standby`,输出应该类似于以下内容: ``` GigabitEthernet0/1 - Group 1 State is Standby 5 state changes, last state change 00:04:13 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.672 secs Preemption disabled Standby router is local Priority 110 (configured 110) Group name is "hsrp-GigabitEthernet0/1-1" (default) ``` 可以看到,交换机 2 的状态是 Standby,它拥有虚拟 IP 地址 192.168.1.254,它的优先级为 110。备份路由器是本地路由器,而不是交换机 1。 现在,我们可以测试 HSRP 的故障转移功能。在交换机 1 上,输入命令 `shutdown` 关闭 GigabitEthernet0/1 接口,然后在交换机 2 上输入命令 `show standby`,输出应该类似于以下内容: ``` GigabitEthernet0/1 - Group 1 State is Active 7 state changes, last state change 00:00:24 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.688 secs Preemption enabled Active router is local Standby router is unknown Priority 120 (configured 120) Group name is "hsrp-GigabitEthernet0/1-1" (default) ``` 可以看到,交换机 2 成为了活动路由器,并拥有虚拟 IP 地址 192.168.1.254。 这就是一个简单的思科交换机 HSRP 实验

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值