VRRP的概述与配置

一、概述

1、VRRP是什么?
VRRP(Virtual Router Redundancy Protocol)虚拟路由冗余协议 它是一种多机热备技术,可以提升网络拓扑的可靠性。
2、基本概念
Master: 主要起转发报文的作用
Backup: 备用路由器
Virtual IP Address: 虚拟IP地址,作为PC机上的网关

二、配置

注:本次是在EVE-NG下的思科设备上配置

1、拓扑图

拓扑图

2、配置命令
(1)在R1上配置
Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname R1
R1(config)#interface ethernet0/0
R1(config-if)#ip address 192.168.1.254 255.255.255.0
R1(config-if)#no shut 
R1(config-if)#vrrp 1 ip 192.168.1.254 
R1(config-if)#vrrp 1 priority 120
R1(config-if)#vrrp 1 preempt 
R1(config-if)#interface ethernet0/1
R1(config-if)#ip address 192.168.12.1 255.255.255.252
R1(config-if)#no shut
R1(config-if)#exit
R1(config)#router ospf 1
R1(config-router)#network 192.168.12.0 0.0.0.3 area 0
R1(config-router)#network 192.168.1.0 0.0.0.255 area 0
R1(config-router)#exit
R1(config)#do write
Building configuration...
[OK]
R1(config)#
(2)在R2上配置
Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname R2
R2(config)#interface ethernet0/0
R2(config-if)#ip address 192.168.1.253 255.255.255.0
R2(config-if)#no shut 
R2(config-if)#vrrp 1 ip 192.168.1.254 
R2(config-if)#vrrp 1 priority 90
R2(config-if)#vrrp 1 preempt 
R2(config-if)#interface ethernet0/2
R2(config-if)#ip address 192.168.12.5 255.255.255.252
R2(config-if)#no shut
R2(config-if)#exit
R2(config)#router ospf 1
R2(config-router)#network 192.168.12.4 0.0.0.3 area 0
R2(config-router)#network 192.168.1.0 0.0.0.255 area 0
R2(config-router)#exit
R2(config)#do write
Building configuration...
[OK]
R2(config)#

(3)在R3上配置
Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname R3
R3(config)#interface ethernet0/1
R3(config-if)#ip address 192.168.12.2 255.255.255.252
R3(config-if)#no shut 
R3(config-if)#interface ethernet0/2
R3(config-if)#ip address 192.168.12.6 255.255.255.252
R3(config-if)#no shut
R3(config-if)#interface loopback 1
R3(config-if)#ip address 192.168.2.1 255.255.255.0
R3(config-if)#no shut 
R3(config-if)#exit
R3(config)#router ospf 1
R3(config-router)#network 192.168.12.0 0.0.0.7 area 0
R3(config-router)#network 192.168.2.0 0.0.0.255 area 0
R3(config-router)#exit
R3(config)#do write
Building configuration...
[OK]
R3(config)#

(4)在VPC上配置
ip 192.168.1.1/24 192.168.1.254
配置完成后检测一下

看一下在R1 Down掉之前 由VPC到R3的的路径是什么

VPCS> tracer 192.168.2.1
trace to 192.168.2.1, 8 hops max, press Ctrl+C to stop
 1   192.168.1.254   3.647 ms  4.862 ms  3.023 ms
 2   *192.168.12.2   3.145 ms (ICMP type:3, code:3, Destination port unreachable)  *

在R1 Down掉之前 由VPC到R3是经过的R1路由器
然后 关闭R1
看一下VPC到R3的的路径是否有变化

 VPCS> tracer 192.168.2.1 
trace to 192.168.2.1, 8 hops max, press Ctrl+C to stop
 1   192.168.1.253   1.708 ms  1.066 ms  0.832 ms
 2   *192.168.12.6   1.732 ms (ICMP type:3, code:3, Destination port unreachable)  *

可以看到路径已经切换了。

  • 1
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值