ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

VRRP原理及配置

2021-05-31 08:32:20  阅读:188  来源: 互联网

标签:int ip 配置 GigabitEthernet0 VRRP SW1 原理 SW3 SW2


VRRP基本概述

VRRP能够在不改变组网的情况下,将多台路由器虚拟成一个虚拟路由器,通过配置虚拟路由器的IP地址为默认网关,实现网关的备份。

协议版本:VRRPv2 和VRRPv3

VRRPv2仅适用于IPv4网络,VRRPv3适用于IPv4和IPv6网络

VRRP协议报文:只有一种报文 Advertisement报文,其目的IP地址是224.0.0.18,目的MAC地址是01-00-5e-00-00-12,协议号112。

 VRRP基本结构

 

 

 VRRP状态机

 

 

 

开启VRRP的设备有三种状态:

  • Initialize:初始化状态,设备刚开机或宕机。
  • Backup:备份状态,设备进行VRRP协商的状态
  • Master:主状态,设备处于转发状态,是优先级最高的Backup设备。

 

 

 

 

VRRP配置实现

 

 

##SW3##

[SW3]vlan bat 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.

[SW3]int e0/0/1
[SW3-Ethernet0/0/1]p l a
[SW3-Ethernet0/0/1]p d v 10
[SW3-Ethernet0/0/1]un sh
Info: Interface Ethernet0/0/1 is not shutdown.


[SW3-Ethernet0/0/1]int e0/0/2
[SW3-Ethernet0/0/2]p l a
[SW3-Ethernet0/0/2]p d v 20
[SW3-Ethernet0/0/2]un sh
Info: Interface Ethernet0/0/2 is not shutdown.


[SW3-Ethernet0/0/2]int g0/0/1
[SW3-GigabitEthernet0/0/1]p l t
[SW3-GigabitEthernet0/0/1]p t a v 10 20
[SW3-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.


[SW3-GigabitEthernet0/0/1]int g0/0/2
[SW3-GigabitEthernet0/0/2]p l t
[SW3-GigabitEthernet0/0/2]p t a v 10 20
[SW3-GigabitEthernet0/0/2]un sh
Info: Interface GigabitEthernet0/0/2 is not shutdown.

 

 

 

##SW1##
[SW1]vlan bat 10 20 100
Info: This operation may take a few seconds. Please wait for a moment...done.

[SW1]int g0/0/1 [SW1-GigabitEthernet0/0/1]p l a [SW1-GigabitEthernet0/0/1]p d v 100 [SW1-GigabitEthernet0/0/1]un sh Info: Interface GigabitEthernet0/0/1 is not shutdown.
[SW1-GigabitEthernet0/0/1]int g0/0/2 [SW1-GigabitEthernet0/0/2]p l t [SW1-GigabitEthernet0/0/2]p t a v 10 20 [SW1-GigabitEthernet0/0/2]un sh Info: Interface GigabitEthernet0/0/2 is not shutdown.
[SW1-GigabitEthernet0/0/2]int vlanif10 [SW1-Vlanif10]ip add 192.168.10.10 24 [SW1-Vlanif10]vrrp vrid 1 virtual [SW1-Vlanif10]vrrp vrid 1 virtual-ip 192.168.10.1 [SW1-Vlanif10]vrrp vrid 1 priority 120 [SW1-Vlanif10]vrrp vrid 1 track interface g0/0/1 [SW1-Vlanif10]vrrp vrid 1 track interface g0/0/2
[SW1-Vlanif10]int vlanif20 [SW1-Vlanif20]ip add 192.168.20.10 24 [SW1-Vlanif20]vrrp vrid 2 virtual-ip 192.168.20.1 [SW1-Vlanif20]vrrp vrid 2 priority 115
[SW1-Vlanif20]int vlanif 100 [SW1-Vlanif100]ip add 11.0.0.2 30 [SW1-Vlanif100]q [SW1]ip route-static 0.0.0.0 0.0.0.0 11.0.0.1

  

##SW2##
[SW2]vlan bat 10 20 100
Info: This operation may take a few seconds. Please wait for a moment...done.

[SW2]int g0/0/1
[SW2-GigabitEthernet0/0/1]p l a
[SW2-GigabitEthernet0/0/1]p d v 100
[SW2-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.

[SW2-GigabitEthernet0/0/1]int g0/0/2
[SW2-GigabitEthernet0/0/2]p l t	
[SW2-GigabitEthernet0/0/2]p t a v 10 20
[SW2-GigabitEthernet0/0/2]un sh
Info: Interface GigabitEthernet0/0/2 is not shutdown.

[SW2-GigabitEthernet0/0/2]int vlanif 10
[SW2-Vlanif10]ip add 192.168.10.20 24	
[SW2-Vlanif10]vrrp vrid 1 virtual-ip 192.168.10.1	
[SW2-Vlanif10]vrrp vrid 1 priority 115

[SW2-Vlanif10]int vlanif20
[SW2-Vlanif20]ip add 192.168.20.20 24
[SW2-Vlanif20]vrrp vrid 2 virtual-ip 192.168.20.1	
[SW2-Vlanif20]vrrp vrid 2 priority 120	
[SW2-Vlanif20]vrrp vrid 2 track interface g0/0/1
[SW2-Vlanif20]vrrp vrid 2 track interface g0/0/2

[SW2-Vlanif20]int vlanif100
[SW2-Vlanif100]ip add 12.0.0.2 30
[SW2-Vlanif100]q

[SW2]ip route-static 0.0.0.0 0.0.0.0 12.0.0.1

  

##R1##
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 11.0.0.1 30

[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 12.0.0.1 30

[R1-GigabitEthernet0/0/1]int loo 0
[R1-LoopBack0]ip add 1.1.1.1 24

[R1]ip route-static 192.168.10.0 24 11.0.0.2
[R1]ip route-static 192.168.10.0 24 12.0.0.2 pre 70
[R1]ip route-static 192.168.20.0 24 12.0.0.2
[R1]ip route-static 192.168.20.0 24 11.0.0.2 pre 70

  

 

标签:int,ip,配置,GigabitEthernet0,VRRP,SW1,原理,SW3,SW2
来源: https://www.cnblogs.com/Rui-Lin/p/14814726.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有