欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

QCNA学习笔记-VRRP虚拟路由器冗余协议

程序员文章站 2024-02-17 11:54:40
...

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

协议版本:VRRPv2(常用)和VRRPv3

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

VRRP协议报文:

只有一种报文:Advertisement报文,协议号是112

真实地址(接口的地址) VS 虚拟地址(网关地址)

Master设备(负责转发用户的流量) VS Backup设备(侦听Master)

思科华为配置VRRP

SW2:
interface Vlanif8
 ip address 10.1.10.12 255.255.255.240
 vrrp vrid 8 virtual-ip 10.1.10.14
 vrrp vrid 8 priority 110
!
interface Vlanif8
 ip address 10.1.10.13 255.255.255.240
 vrrp vrid 8 virtual-ip 10.1.10.14
验证:
[SW1]display vrrp brief 
VRID  State        Interface                Type     Virtual IP     
----------------------------------------------------------------
8     Master       Vlanif8                  Normal   10.1.10.14     
---------------------------------------------------------------
Total:1     Master:1     Backup:0     Non-active:0  
[SW2]dis vrrp brief 
VRID  State        Interface                Type     Virtual IP     
----------------------------------------------------------------
8     Backup       Vlanif8                  Normal   10.1.10.14     
---------------------------------------------------------------
Total:1     Master:0     Backup:1     Non-active:0

PC>ping 10.1.10.14

Ping 10.1.10.14: 32 data bytes, Press Ctrl_C to break
From 10.1.10.14: bytes=32 seq=1 ttl=255 time=31 ms
From 10.1.10.14: bytes=32 seq=2 ttl=255 time=47 ms
From 10.1.10.14: bytes=32 seq=3 ttl=255 time=32 ms
From 10.1.10.14: bytes=32 seq=4 ttl=255 time=47 ms
From 10.1.10.14: bytes=32 seq=5 ttl=255 time=47 ms

--- 10.1.10.14 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 31/40/47 ms

PC>arp -a

Internet Address    Physical Address    Type
10.1.10.14          00-00-5E-00-01-08   dynamic
!
Cisco
SW1(config-if)#vrrp 8 ip 10.1.10.14
SW1(config-if)#vrrp 8 priority 110
SW2(config-if)#vrrp 8 ip 10.1.10.14
SW2#show vrrp brief 
Interface          Grp Pri Time  Own Pre State   Master addr     Group addr
Vl8                8   100 3609       Y  Backup  10.1.10.13      10.1.10.14 

Master的选举原则

优先级数值较大者,(HW:如果已经选举出Master,后来者无效,除非优先级较大)2)

IP较大者。优先级:可视的取值范围(1-254),255不可配置(真实IP=虚拟IP时)

操控Master设备

一个重要原则:VRRP的master=STP的根(否则出现次优转发路径)

相关标签: 网络 运维