当前位置:网站首页>三层交换和VRRP
三层交换和VRRP
2022-07-28 05:29:00 【花生味花生米】
目录
前言
虚拟路由冗余协议(Virtual Router Redundancy Protocol,简称VRRP)是由IETF提出的解决局域网中配置静态网关出现单点失效现象的路由协议,1998年已推出正式的RFC2338协议标准。VRRP广泛应用在边缘网络中,它的设计目标是支持特定情况下IP数据流量失败转移不会引起混乱,允许主机使用单路由器,以及即使在实际第一跳路由器使用失败的情形下仍能够维护路由器间的连通性。
一.三层交换
三层交换:二层交换和三层转发
包含两个信息表
转发信息表(FIB):FIB类似于路由表,包含路由表中转发信息的镜像。当网络的拓扑发生变化时,路由表将被更新,而FIB也将随之变化。
邻接关系表:每个FIB条目,邻接关系表中都包含相应的第2层地址。
二.三层交换工作原理

PC1给pc2发单播数据包
交换机查找FIB表,找到下一跳地址
查找一条地址对应的领接关系的二层封装信息
转发数据
三.vrrp的作用
虚拟路由器冗余协议(VRRP)是一种选择协议,它可以把一个虚拟路由器的责任动态分配到局域网上的 VRRP 路由器中的一台。控制虚拟路由器 IP 地址的 VRRP 路由器称为主路由器,它负责转发数据包到这些虚拟 IP 地址。一旦主路由器不可用,这种选择过程就提供了动态的故障转移机制,这就允许虚拟路由器的 IP 地址可以作为终端主机的默认第一跳路由器。使用 VRRP 的好处是有更高的默认路径的可用性而无需在每个终端主机上配置动态路由或路由发现协议。 VRRP 包封装在 IP 包中发送。
四.vrrp工作过程
1. VRRP组中的设备选举出Master。Master设备通过发送ARP报文,将虚拟MAC地址通知给与它连接的设备或者主机。
2. Master设备周期性向备份组内所有Backup设备发送VRRP通告报文。
3.如果Master设备出现故障,VRRP备份组中的Backup设备重新选举新的Master。
4. 原Master设备故障恢复时,若该设备IP地址大于被抢占的master,将决定重新选举master。
五.vrrp配置

SW1
undo t m
system-view
user-interface console 0
idle-timeout 0
q
vlan b 10 20
int e0/0/1
port link-type access
port default vlan 10
int e0/0/2
port link-type access
port default vlan 20
int g0/0/1
port link-type trunk
port trunk allow-pass vlan all
int g0/0/2
port link-type trunk
port trunk allow-pass vlan all
q
SW2
undo t m
system-view
user-interface console 0
idle-timeout 0
q
vlan b 10 20 30
int g0/0/1
port link-type trunk
port trunk allow-pass vlan all
q
int vlan 10
ip add 192.168.10.100 24
vrrp vrid 1 virtual-ip 192.168.10.1
vrrp vrid 1 preempt-mode timer delay 6
vrrp vrid 1 priority 105
vrrp vrid 1 track int g0/0/2
int vlan 20
ip add 192.168.20.100 24
vrrp vrid 2 virtual-ip 192.168.20.1
vrrp vrid 2 track int g0/0/2
int g0/0/2
port link-type access
port default vlan 30
int vlan 30
ip add 192.168.30.1 24
q
LSW3
undo t m
system-view
user-interface console 0
idle-timeout 0
q
vlan b 10 20 30
int g0/0/1
port link-type trunk
port trunk allow-pass vlan all
q
int vlan 10
ip add 192.168.10.110 24
vrrp vrid 1 virtual-ip 192.168.10.1
vrrp vrid 1 track int g0/0/2
int vlan 20
ip add 192.168.20.110 24
vrrp vrid 2 virtual-ip 192.168.20.1
vrrp vrid 2 preempt-mode timer delay 6
vrrp vrid 2 priority 105
vrrp vrid 2 track int g0/0/2
int g0/0/2
port link-type access
port default vlan 30
int vlan 30
ip add 192.168.40.1 24
q
R1
undo t m
system-view
user-interface console 0
idle-timeout 0
q
int g0/0/0
ip add 192.168.30.2 24
int g0/0/1
ip add 192.168.40.2 24
int lo0
ip add 30.0.0.1 24
q
ip route-static 192.168.10.0 24 192.168.30.1
ip route-static 192.168.10.0 24 192.168.40.1 preference 70
ip route-static 192.168.20.0 24 192.168.30.1
ip route-static 192.168.20.0 24 192.168.40.1 preference 70

切断sw2,查看是否被备份路由抢占



总结
三层路由,一次路由,多次转发
vrrp实现一主多备,来解决单点故障
通过识别优先级和ip,大的会被名为master
边栏推荐
- Esxi community network card driver updated again
- Ubuntu18.04+Centos7配置redis主从【学习笔记】
- What kind of air conduction Bluetooth headset with good configuration is recommended
- DNS正向解析实验
- Shell script - sort, uniq, TR, array sort, cut, Eval command configuration
- Life cycle (process) of software testing
- KVM热迁移
- RAID disk array
- On cookies and session
- Si Han talks about the professional development of testers
猜你喜欢

Network - transport layer (detailed version)

Installation and configuration of unit test framework jest with typescript

Which brand of air conduction earphones is good and highly praised

Applets: lifecycle

Detailed explanation of LNMP construction process

raid磁盘阵列

组管理和权限管理

MySQL主从

RAID磁盘阵列

On cookies and session
随机推荐
Result number of filled briquettes
On cookies and session
Difference between process and thread
Scratch command
Detailed explanation of LNMP construction process
QGraphicsView提升为QChartView
Ubuntu18.04搭建redis集群【学习笔记】
Shell script -- program conditional statements (conditional tests, if statements, case branch statements, echo usage, for loops, while loops)
OSI seven layer model
NFS shared storage service
NFS 共享存储服务
DHCP服务
[learning notes] VIM editor
RAID磁盘阵列
Principle and configuration of NAT and pat
Software testing (concept)
Common models in software development
Custom components -- styles
防火墙——iptables防火墙(四表五链、防火墙配置方法、匹配规则详解)
Shell script - "three swordsmen" awk command