概述
VRRP技术–虚拟路由器冗余协议
1,概述,利用VRRP,一组路由器协同工作,只有一个处于MASTER状态,处于该状态的路由器几口承担实际数据流量转发任务,多个接口共用一个虚拟IP地址,
VRRP决定那个路由器是MASTER,并负责接受发送至用户数据包并进行转发,相应ARP请求
Backkuo路预期箭筒master路由器状态,并在他发生故障时,接替其工作
2,VRRP中,一台路由器接口可以同时参与多个VRRP组中,不同组中充当不同角色
3,VRRP组,每个组中只有一个master
4,虚拟MAC地址,根据VRID生成,一个虚拟路由只有一个虚拟路由
5,Backup路由,处于监听状态,每个1s发送心跳报文,3秒没有收到默认master出现故障,进行替换
6,选举依据:先笔记接口VRRP优先级(比大),默认为100,可配置范围为1-254,相同,比较接口IP地址
7,VRRP状态机,初始状态initialize
8,Master路由器。
定时发送vrrp通告报文,告知backup自己的存活状态
以虚拟MAC地址相应ARP请求
转发报文
如果收到比自己优先级大的报文,立即成为backup
9,backup路由
接受master状态信息,判断其状态
对ARP不做相应
丢弃报文
如果收到优先级和自己相同,或比自己大的
10,vrrp报文
采用组播,224.0.0.18
11,工作过程
选举master,将虚拟MAC地址通知主机,
向其他backup设备通告报文
当vrrp组切换时,新的master立即携带虚拟mac和虚拟IP舒心主机设备中的mac地址,把用户流量引导新的额设备上去
原master故障回复时,若该设备为IP地址拥有者(则其优先级为 255),直接进入master状态
backup设备优先级高于master设备时,由backup设备的工作方式(抢占和非抢占模式)决定是否重新选举master
12,命令配置
Dis vrrp brief 查看vrrp状态
Vrrp vrid 1 track int g0/0/1 reduced 20 配置后面接口优先级
[r1-GigabitEthernet0/0/0.1]vrrp vrid 1 virtual-ip 192.168.1.254
[r1-GigabitEthernet0/0/0.1]vrrp vrid 1 priority 110
作业
1,
sw1
[sw1]valn b 10 20
[sw1]vlan b
[sw1]vlan batch 10 20
[sw1]int vlanif 10
[sw1-Vlanif10]ip add 192.168.1.252 24
[sw1-Vlanif10]vrrp vrid 1 virtual-ip 192.168.1.254
[sw1-Vlanif10]vrrp vrid 1 priority 110
[sw1-Vlanif10]q
[sw1]int vlanif 20
[sw1-Vlanif20]ip add 192.168.2.253 24
[sw1-Vlanif20]vrrp vrid 2 virtual-ip 192.168.2.254
[sw1-Vlanif20]q
[sw1]int g0/0/1
[sw1-GigabitEthernet0/0/1]p l t
[sw1-GigabitEthernet0/0/1]p t a v a
sw2
[sw2]vlan batch 10 20
[sw2]int vlanif 10
[sw2-Vlanif10]ip add 192.168.1.253 24
[sw2-Vlanif10]vrrp vrid 1 virtual-ip 192.168.1.254
[sw2-Vlanif10]int vlanif 20
[sw2-Vlanif20]ip add 192.168.2.252 24
[sw2-Vlanif20]vrrp vrid 2 virtual-ip 192.168.2.254
[sw2-Vlanif20]vrrp vrid 2 priority 110
[sw2-Vlanif20]q
[sw2]int g0/0/1
[sw2-GigabitEthernet0/0/1]p l t
[sw2-GigabitEthernet0/0/1]p t a v a
sw3
[sw3]vlan batch 10 20
[sw3-GigabitEthernet0/0/1]p l a
[sw3-GigabitEthernet0/0/1]p d v 10
[sw3-GigabitEthernet0/0/1]int g0/0/2
[sw3-GigabitEthernet0/0/2]p l a
[sw3-GigabitEthernet0/0/2]p d v 20
[sw3-GigabitEthernet0/0/2]int g0/0/3
[sw3-GigabitEthernet0/0/3]p l t
[sw3-GigabitEthernet0/0/3]p t a v a
[sw3-GigabitEthernet0/0/3]int g0/0/4
[sw3-GigabitEthernet0/0/4]p l t
[sw3-GigabitEthernet0/0/4]p t a v a
pc1通网关
pc2通网关
当断掉一条线路时,仍然可以通
2,
r1
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.252 24
[r1-GigabitEthernet0/0/0]ip add 192.168.2.253 24 sub
[r1-GigabitEthernet0/0/0]vrrp vrid 1 virtual-ip 192.168.1.254
[r1-GigabitEthernet0/0/0]vrrp vrid 2 virtual-ip 192.168.2.254
[r1-GigabitEthernet0/0/0]vrrp vrid 1 priority 110
[r1]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 192.168.10.1 24
[r1-GigabitEthernet0/0/1]q
[r1]ip route-static 3.3.3.3 32 192.168.10.2
r2
[r2-GigabitEthernet0/0/0]ip add 192.168.2.252 24
[r2-GigabitEthernet0/0/0]ip add 192.168.1.253 24 sub
[r2-GigabitEthernet0/0/0]vrrp vr
[r2-GigabitEthernet0/0/0]vrrp vrid 1 vi
[r2-GigabitEthernet0/0/0]vrrp vrid 1 virtual-ip 192.168.1.254
[r2-GigabitEthernet0/0/0]vrrp vrid 2 virtual-ip 192.168.2.254
[r2-GigabitEthernet0/0/0]vrrp vr
[r2-GigabitEthernet0/0/0]vrrp vrid 2 pri
[r2-GigabitEthernet0/0/0]vrrp vrid 2 priority 110
[r2]dis vrrp brief
1 Backup GE0/0/0 Normal 192.168.1.254
2 Master GE0/0/0 Normal 192.168.2.254
[r2]int g0/0/1
[r2-GigabitEthernet0/0/1]ip add 192.168.20.1 24
[r2-GigabitEthernet0/0/1]q
[r2]ip route-static 3.3.3.3 32 192.168.20.2
r3
r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.10.2 24
[r3-GigabitEthernet0/0/0]int g0/0/1
[r3-GigabitEthernet0/0/1]ip add 192.168.20.2 24
[r3-GigabitEthernet0/0/1]q
[r3]ip route-static 192.168.1.0 24 192.168.10.1
[r3]ip route-static 192.168.2.0 24 192.168.10.1
[r3]ip route-static 192.168.2.0 24 192.168.20.1
[r3]ip route-static 192.168.1.0 24 192.168.20.1
[r3]int LoopBack 0
[r3-LoopBack0]ip add 3.3.3.3 32
pc1通3.3.3.3
pc2通3.3.3.3
当断掉一条线路时
扔能ping通
sw1
[Huawei]sysn sw1
[sw1]vlan b 10 20
[sw1]int vlanif 10
[sw1-Vlanif10]ip add 192.168.1.252 24
[sw1-Vlanif10]vrrp vrid 1 virtual-ip 192.168.1.254
[sw1-Vlanif10]vrrp vrid 1 priority 110
[sw1-Vlanif10]int vlanif 20
[sw1-Vlanif20]ip add 192.168.2.253 24
[sw1-Vlanif20]vrrp vrid 2 virtual-ip 192.168.2.254
[sw1-Vlanif20]q
[sw1]int g0/0/1
[sw1-GigabitEthernet0/0/1]p l t
[sw1-GigabitEthernet0/0/1]p t a v a
[sw1-GigabitEthernet0/0/1]int g0/0/2
[sw1-GigabitEthernet0/0/2]p l t
[sw1-GigabitEthernet0/0/2]p t a v a
[sw1]stp region-configuration
[sw1-mst-region]region-name hua
[sw1-mst-region]instance 1 vlan 10
[sw1-mst-region]instance 2 vlan 20
[sw1-mst-region]active region-configuration
[sw1-mst-region]q
[sw1]stp instance 1 root primary
[sw1]stp instance 2 root secondary
sw2
[Huawei]sysn sw2
[sw2]vlan b
[sw2]vlan batch 10 20
[sw2]int vlanif 10
[sw2-Vlanif10]ip add 192.168.1.253 24
[sw2-Vlanif10]vrrp vrid 1 virtual-ip 192.168.1.254
[sw2-Vlanif10]int vlanif 20
[sw2-Vlanif20]ip add 192.168.2.252 24
[sw2-Vlanif20]vrrp vrid 2 virtual-ip 192.168.2.254
[sw2-Vlanif20]vrrp vrid 2 priority 110
[sw2-Vlanif20]q
[sw2]int g0/0/1
[sw2-GigabitEthernet0/0/1]p l t
[sw2-GigabitEthernet0/0/1]p t a v a
[sw2-GigabitEthernet0/0/1]int g0/0/2
[sw2-GigabitEthernet0/0/2]p l t
[sw2-GigabitEthernet0/0/2]p t a v a
[sw2-GigabitEthernet0/0/2]q
[sw2]stp region-configuration
[sw2-mst-region]region-name hua
[sw2-mst-region]instance 1 vlan 10
[sw2-mst-region]instance 2 vlan 20
[sw2-mst-region]active region-configuration
[sw2-mst-region]q
[sw2]stp instance 2 primary
[sw2]stp instance 2 root primary
[sw2]stp instance 1 root secondary
sw3
[sw3]vlan batch 10 20
[sw3]int g0/0/1
[sw3-GigabitEthernet0/0/1]p l a
[sw3-GigabitEthernet0/0/1]p d v 10
[sw3-GigabitEthernet0/0/1]int g0/0/2
[sw3-GigabitEthernet0/0/2]p l a
[sw3-GigabitEthernet0/0/2]p d v 20
[sw3-GigabitEthernet0/0/2]int g0/0/3
[sw3-GigabitEthernet0/0/3]p l t
[sw3-GigabitEthernet0/0/3]p t a v a
[sw3-GigabitEthernet0/0/3]int g0/0/4
[sw3-GigabitEthernet0/0/4]p l t
[sw3-GigabitEthernet0/0/4]p t a v a
[sw3-GigabitEthernet0/0/4]
[sw3-GigabitEthernet0/0/4]q
[sw3]vlan batch 10 20
[sw3]stp re
[sw3-mst-region]re
[sw3-mst-region]region-name hua
[sw3-mst-region]instance 1 vlan 10
[sw3-mst-region]instance 2 vlan 20
[sw3-mst-region]active re
[sw3]dis stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/1 DESI DISCARDING NONE
0 GigabitEthernet0/0/2 DESI DISCARDING NONE
0 GigabitEthernet0/0/3 DESI FORWARDING NONE
0 GigabitEthernet0/0/4 DESI FORWARDING NONE
1 GigabitEthernet0/0/1 DESI DISCARDING NONE
1 GigabitEthernet0/0/3 ROOT FORWARDING NONE
1 GigabitEthernet0/0/4 ALTE DISCARDING NONE
2 GigabitEthernet0/0/2 DESI DISCARDING NONE
2 GigabitEthernet0/0/3 ALTE DISCARDING NONE
2 GigabitEthernet0/0/4 ROOT FORWARDING NONE
pc1通pc2
最后
以上就是无奈仙人掌为你收集整理的VRRP技术VRRP技术–虚拟路由器冗余协议作业的全部内容,希望文章能够帮你解决VRRP技术VRRP技术–虚拟路由器冗余协议作业所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复