【ENSP】VRRP协议双组双备(鱼形拓扑图)实验


VRRP模式它使用IP多播数据包进行封装

组播地址:224.0.0.18

VRRP可以分摊压力,将事故风险降低到最小

1.注意事项

浮动路由默认优先级是60,越小越优,如果是第二条路由优先级比默认要大,一般配置60以上

2.VRRP(公有协议)

在多个路由器之间运行,可以虚拟出一个或者多个网关IP地址(虚拟路由器)
从而实现内网不同网段之间的互通

3.VRRP的工作过程

运行Vrrp的“多个”路由器之间通过Vrrp报文的交互,从而选择出一个最牛的路由器,作为master路由器
以后就用这个设备转发数据包

master路由器,仅仅只有一个,其他的路由器成为backup路由器

同时,master和Backup路由器,会产生一个虚拟的路由器,也就是一个虚拟的IP地址

实验拓扑图

在这里插入图片描述
要求:把需要配置的各个节点标在拓扑图上,降低操作失误

实验工具

1,LSW1为192.168.10.0/24网段的主路由,192.168.20.0/24网段的备用路由

2,LSW2为192.168.20.0/24网段的主路由,192.168.10.0/24网段的备用路由

3,当断掉某个网段的主路由时,通过vrrp协议备用路由自动启用。

4,断开接口抓报文

命令配置

LSW3


<Huawei>system-view 
[Huawei]sysname SW3
[SW3]v b 10 20                                                  创建vlan10和vlan20的标签
[SW3]int e0/0/1
[SW3-Ethernet0/0/1]p l a                                        设置成access口
[SW3-Ethernet0/0/1]p d v 10                                     打上vlan10的标签
[SW3-Ethernet0/0/1]int e0/0/2
[SW3-Ethernet0/0/2]p l a                                        设置成access口 
[SW3-Ethernet0/0/2]p d v 20                                     打上vlan20的标签
[SW3-Ethernet0/0/2]un sh                                        开启接口
[SW3-Ethernet0/0/2]int g0/0/1                  
[SW3-GigabitEthernet0/0/1]un sh
[SW3-GigabitEthernet0/0/1]int g0/0/1  
[SW3-GigabitEthernet0/0/1]p l t                               设置成trunk口                     
[SW3-GigabitEthernet0/0/1]p t a v 10 20                       允许带10和20标签的数据通过
[SW3-GigabitEthernet0/0/1]dis this                            这条命令可查看当前接口的配置信息

interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 10 20

[SW3-GigabitEthernet0/0/1]un sh
                                                              同样我们设置G0/0/2口
[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

接下来设置LSW1




<Huawei>system-view 
[Huawei]sysname SW1

[SW1]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]q

[SW1]v b 10 20 100
[SW1]int g0/0/1
[SW1-GigabitEthernet0/0/1]p l a 
[SW1-GigabitEthernet0/0/1]p d v 100
[SW1-GigabitEthernet0/0/1]q

[SW1]int Vlanif 10
[SW1-Vlanif10]vrrp vrid 1 virtual-ip 192.168.10.1 24                           
[SW1-Vlanif10]vrrp vrid 1 virtual-ip 192.168.10.1                   配置虚拟IP地址
[SW1-Vlanif10]vrrp vrid 1 priority 120                              配置优先级120
[SW1-Vlanif10]vrrp vrid 1 track interface g0/0/1      配置监听端口g0/0/1,当这个地方Down优先级减10
[SW1-Vlanif10]vrrp vrid 1 track interface g0/0/2      配置监听端口g0/0/2,当这个地方Down优先级减10
[SW1-Vlanif10]q

[SW1]int Vlanif 20
[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]int Vlanif 100
[SW1-Vlanif100]ip add 11.0.0.2 30

[SW1]ip route-static 0.0.0.0 0.0.0.0 11.0.0.1                     设置默认路由

LSW2的配置


<Huawei>system-view 
[Huawei]sysname SW2
[SW2]v b 10 20 100

[SW2]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]int g0/0/1
[SW2-GigabitEthernet0/0/1]p l a 
[SW2-GigabitEthernet0/0/1]p d v 100
[SW2-GigabitEthernet0/0/1]q

[SW2]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]q

[SW2]int Vlanif 20
[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]q

[SW2]ip route-static 0.0.0.0 0.0.0.0 12.0.0.1

[SW2]int Vlanif 100
[SW2-Vlanif100]ip add 12.0.0.2 30

R1的配置

<Huawei>system-view 
[Huawei]sysname R1

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

[R1]ip route-static 192.168.10.0 24 11.0.0.2                     192.168.10.0的网段优先走SW1
[R1]ip route-static 192.168.10.0 24 12.0.0.2 preference 70


[R1]ip route-static 192.168.20.0 24 12.0.0.2                     192.168.20.0的网段优先走SW2
[R1]ip route-static 192.168.20.0 24 11.0.0.2 preference 70

[R1]int LoopBack 0
[R1-LoopBack0]ip add 1.1.1.1 24

开启抓包软件验证

在这里插入图片描述

在这里插入图片描述

使用Wireshark抓包软件论证

首先我们在正常情况下
点击LSW1 g0/0/2的接口开始抓包

在这里插入图片描述
在这里插入图片描述

这时候我们把LSW1的g0/0/1口Down掉

在这里插入图片描述

在这里插入图片描述
原先优先级处于120所以走的LSW1,当接口Down掉了以后,优先级减10变成110
这个时候LSW2处于115的优先级,所以会优先走LSW2

在这里插入图片描述

这样VRRP双组双备就已完成

猜你喜欢

转载自blog.csdn.net/weixin_48190891/article/details/107039569
今日推荐