ensp基于 VRRP 的负载均衡出口链路配置

这篇具有很好参考价值的文章主要介绍了ensp基于 VRRP 的负载均衡出口链路配置。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

1.项目背景

公司采用 ISP-A、ISP-B 线路接入互联网,通过出口路由器 R1、R2 连接,通过
VRRP 功能实现了路由器的主备自动切换。由于公司业务的开展,原来的主备链路模式无法
满足出口带宽的需求,现需更改为负载均衡模式,在出口链路互为备份的同时还能分流出口
流量,增加出口带宽。公司拓扑如图 1 所示,项目具体要求如下:
(1) 路由器 R1 和 R2 通过拨号方式接入到互联网,R3 为互联网中的路由器;
(2) 公司要求配置部分计算机从 R1 访问 Internet,部分计算机从 R2 访问 Internet,
且要求当 R1 或 R2 链路故障时,自动切换到无故障链路上,既保障充分利用出
口流量还能在出现链路故障时确保网络的连通性。
(3) 路由器间采用 OSPF 动态路由协议互联;
(4) 拓扑测试计算机和路由器的 IP 和接口信息如拓扑所示。
ensp基于 VRRP 的负载均衡出口链路配置

2.项目规划设计

为实现双出口的流量负载均衡,可以为不同的计算机指定不同的网关,使内部流量能通
过不同的出口路由器进行转发。网关可以使用多个 VRRP 组来实现,并通过设置 VRRP 组中不
同路由器的优先级,可使不同的虚拟网关以不同的路由器作为主路由器,另一个作为备份路
由器,即可实现流量的分流和链路的备份。
公 司 有 开 发 部 和 市 场 部 2 个部门, IP 地 址 段 分 别 为 192.168.1.1-10/24 和
192.168.1.11-20/24,可以为不同的部门指定不同的出口网关以实现均衡流量。在 R1、R2
上创建 VRRP1 和 VRRP2,并创建虚拟网关地址 192.168.1.253 和 192.168.1.254 分别用于开
发部和市场部的默认网关。其中 VRRP1 的主路由器为 R1,即 R1 的 VRRP1 优先级为 110,R2
的优先级不变;VRRP2 的主路由器为 R2,即 R2 的 VRRP2 优先级为 110,R1 的优先级不变,
这样即可实现流量的负载均衡。同时,配置对 R1、R2 路由器上联接口的链路状态跟踪,当
上联接口的链路状态为 DOWN 时,VRRP 主路由器优先级下降至 50,此时备份路由器即可切换
为主路由器,实现自动的主备链路切换。在互联网连接方面,由于 ISP-A、ISP-B 均采用 OSPF
协议,故所有路由器均配置 OSPF 协议,并设置为 Area0 区域,以实现路由器之间的通信。
配置步骤如下。
(1)配置路由器接口
(2)部署 OSPF 网络
(3)配置 VRRP 协议
(4)配置上行接口监视
(5)配置各部门计算机的 IP 地址
ensp基于 VRRP 的负载均衡出口链路配置
ensp基于 VRRP 的负载均衡出口链路配置
3.项目实施

(1)配置路由器接口

R1 的配置

<Huawei> system-view
[Huawei]sysname R1
[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0] ip address 192.168.1.100 255.255.255.0
[R1]interface GigabitEthernet 0/0/1
[R1-GigabitEthernet0/0/1] ip address 10.10.10.1 255.255.255.0

R2 的配置

[Huawei]system-view
[Huawei]sysname R2
[R2]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0] ip address 192.168.1.200 255.255.255.0
[R2]interface GigabitEthernet 0/0/1
[R2-GigabitEthernet0/0/2] ip address 30.30.30.1 255.255.255.0

R3 的配置

[Huawei]system-view
[Huawei]sysname R3
[R3]interface GigabitEthernet 0/0/0
[R3-GigabitEthernet0/0/2]ip address 20.20.20.1 255.255.255.0
[R3]interface GigabitEthernet 0/0/1
[R3-GigabitEthernet0/0/1]ip address 10.10.10.2 255.255.255.0
[R3]interface GigabitEthernet 0/0/2
[R3-GigabitEthernet0/0/2]ip address 30.30.30.2 255.255.255.0

(2)部署 OSPF 网络

在路由器上配置 OSPF 协议,使用进程号 1,且所有网段均通告进区域 0 中。

R1 的配置

[R1]ospf 1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]network 10.10.10.0 0.0.0.255

R2 的配置

[R2]ospf 1
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]network 30.30.30.0 0.0.0.255

R3 的配置

[R3]ospf 1
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 10.10.10.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 20.20.20.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 30.30.30.0 0.0.0.255

(3)配置 VRRP 协议

在 R1、R2 上配置 VRRP 协议,创建 VRRP 备份组,指定路由器处于同一个 VRRP 备份组
内,VRRP 备份组号为 1,配置虚拟 IP 为 192.168.1.253,VRRP 备份组号为 2,配置虚拟 IP
为 192.168.1.254.
R1 的配置

[R1]interface G0/0/0
[R1-GigabitEthernet0/0/0]vrrp vrid 1 virtual-ip 192.168.1.253
[R1-GigabitEthernet0/0/0] vrrp vrid 2 virtual-ip 192.168.1.254

R2 的配置

[R2]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]vrrp vrid 1 virtual-ip 192.168.1.253
[R2-GigabitEthernet0/0/0]vrrp vrid 2 virtual-ip 192.168.1.254

配置 R1 的备份组号 1 的 VRRP 优先级为 110,R2 的备份组号 2 的 VRRP 优先级为 110,
这样使得 R1 成为 Master,R3 为 Backup。

R1 的配置

[R1-GigabitEthernet0/0/0]vrrp vrid 1 priority 110

R2 的配置

[R2-GigabitEthernet0/0/0] vrrp vrid 2 priority 110

(4)配置上行接口监视

在 R1 上配置 VRRP 备份组 1 上行接口监视,监视上行接口 G0/0/1,当此接口断掉时,
裁剪优先级 60,使优先级变为 50,小于 R2 里 VRRP 备份组 1 的优先级 100。

[R1-GigabitEthernet0/0/0]vrrp vrid 1 track interface GigabitEthernet 0/0/1 reduced 
60

在 R2 上配置 VRRP 备份组 2 上行接口监视,监视上行接口 G0/0/2,当此接口断掉时,
裁剪优先级 60,使优先级变为 50,小于 R1 里 VRRP 备份组 2 的优先级 100。

[R2-GigabitEthernet0/0/0] vrrp vrid 2 track interface GigabitEthernet0/0/2 reduced 
60

(5)配置各部门计算机的 IP 地址

ensp基于 VRRP 的负载均衡出口链路配置

ensp基于 VRRP 的负载均衡出口链路配置
ensp基于 VRRP 的负载均衡出口链路配置

4.项目验证

(1)验证路由器上 OSPF 邻居建立信息
R1 的配置

[R1]dis ospf peer brief
OSPF Process 1 with Router ID 192.168.1.100
 Peer Statistic Information
 ----------------------------------------------------------------------------
Area Id Interface Neighbor id State 
0.0.0.0 GigabitEthernet0/0/0 192.168.1.200 Full 
0.0.0.0 GigabitEthernet0/0/1 10.10.10.2 Full 
----------------------------------------------------------------------------

R2 的配置

[R2]dis ospf peer brief
OSPF Process 1 with Router ID 192.168.1.200
 Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State 
0.0.0.0 GigabitEthernet0/0/0 192.168.1.100 Full 
0.0.0.0 GigabitEthernet0/0/1 10.10.10.2 Full 
----------------------------------------------------------------------------

R3 的配置

[R3]dis ospf peer brief
OSPF Process 1 with Router ID 10.10.10.2
 Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State 
0.0.0.0 GigabitEthernet0/0/1 192.168.1.100 Full 
0.0.0.0 GigabitEthernet0/0/2 192.168.1.200 Full 
----------------------------------------------------------------------------

(2)验证路由器 R1、R2 的 VRRP 信息

R1 的配置

[R1]dis vrrp
 GigabitEthernet0/0/0 | Virtual Router 1
 State : Master
 Virtual IP : 192.168.1.253
 Master IP : 192.168.1.100
 PriorityRun : 110
 PriorityConfig : 110
 MasterPriority : 110
 Preempt : YES Delay Time : 0 s
 TimerRun : 1 s
 TimerConfig : 1 s
 Auth type : NONE
 Virtual MAC : 0000-5e00-0101
 Check TTL : YES
 Config type : normal-vrrp
 Backup-forward : disabled
 Track IF : GigabitEthernet0/0/1 Priority reduced : 60
 IF state : UP
 ……
 GigabitEthernet0/0/0 | Virtual Router 2
 State : Backup
 Virtual IP : 192.168.1.254
 Master IP : 192.168.1.200
 PriorityRun : 100
 PriorityConfig : 100
 MasterPriority : 110
 Preempt : YES Delay Time : 0 s
 TimerRun : 1 s
 TimerConfig : 1 s
 Auth type : NONE
 Virtual MAC : 0000-5e00-0102
 Check TTL : YES
 Config type : normal-vrrp
 Backup-forward : disabled

R2 的配置

[R2]dis vrrp
 GigabitEthernet0/0/0 | Virtual Router 1
 State : Backup
 Virtual IP : 192.168.1.253
 Master IP : 192.168.1.100
 PriorityRun : 100
 PriorityConfig : 100
 MasterPriority : 110
 Preempt : YES Delay Time : 0 s
 TimerRun : 1 s
 TimerConfig : 1 s
 Auth type : NONE
 Virtual MAC : 0000-5e00-0101
 Check TTL : YES
 Config type : normal-vrrp
 Backup-forward : disabled
 ……
 GigabitEthernet0/0/0 | Virtual Router 2
 State : Master
 Virtual IP : 192.168.1.254
 Master IP : 192.168.1.200
 PriorityRun : 110
 PriorityConfig : 110
 MasterPriority : 110
 Preempt : YES Delay Time : 0 s
 TimerRun : 1 s
 TimerConfig : 1 s
 Auth type : NONE
 Virtual MAC : 0000-5e00-0102
 Check TTL : YES
 Config type : normal-vrrp
 Backup-forward : disabled
 Track IF : GigabitEthernet0/0/1 Priority reduced : 60
 IF state : UP

(3)测试各部门访问服务器时的数据包转发路径

PC1

PC>tracert 20.20.20.2
traceroute to 20.20.20.2, 8 hops max
(ICMP), press Ctrl+C to stop
1 192.168.1.200 47 ms 31 ms 47 ms
2 30.30.30.2 47 ms 47 ms 16 ms
3 20.20.20.2 47 ms 46 ms 47 ms

PC2

PC>tracert 20.20.20.2
traceroute to 20.20.20.2, 8 hops max
(ICMP), press Ctrl+C to stop
1 192.168.1.100 31 ms 47 ms 47 ms
2 10.10.10.2 15 ms 47 ms 47 ms
3 20.20.20.2 62 ms 47 ms 47 ms

可以观察到现在已经实现流量负载均衡。

(4)验证 VRRP 主备切换

将 R1 的 G0/0/1 接口关闭

[R1]interface GigabitEthernet 0/0/1
[R1-GigabitEthernet0/0/0]shutdown

经过 3s 左右,使用 display vrrp 查看 R1、R2 的 VRRP 信息。
R1 的配置

[R1]display vrrp
 GigabitEthernet0/0/0 | Virtual Router 1
 State : Backup
 Virtual IP : 192.168.1.253
 Master IP : 192.168.1.200
 PriorityRun : 50
 PriorityConfig : 110
 MasterPriority : 100
 Preempt : YES Delay Time : 0 s
 TimerRun : 1 s
 TimerConfig : 1 s
 Auth type : NONE
 Virtual MAC : 0000-5e00-0101
 Check TTL : YES
 Config type : normal-vrrp
 Backup-forward : disabled
 Track IF : GigabitEthernet0/0/1 Priority reduced : 60
 IF state : DOWN
 ……
 GigabitEthernet0/0/0 | Virtual Router 2
 State : Backup
 Virtual IP : 192.168.1.254
 Master IP : 192.168.1.200
 PriorityRun : 100
 PriorityConfig : 100
 MasterPriority : 110
 Preempt : YES Delay Time : 0 s
 TimerRun : 1 s
 TimerConfig : 1 s
 Auth type : NONE
 Virtual MAC : 0000-5e00-0102
 Check TTL : YES
 Config type : normal-vrrp
 Backup-forward : disabled
 ……

R2 的配置

[R2]dis vrrp
 GigabitEthernet0/0/0 | Virtual Router 1
 State : Master
 Virtual IP : 192.168.1.253
 Master IP : 192.168.1.200
 PriorityRun : 100
 PriorityConfig : 100
 MasterPriority : 100
 Preempt : YES Delay Time : 0 s
 TimerRun : 1 s
 TimerConfig : 1 s
 Auth type : NONE
 Virtual MAC : 0000-5e00-0101
 Check TTL : YES
 Config type : normal-vrrp
 Backup-forward : disabled
 ……
 GigabitEthernet0/0/0 | Virtual Router 2
 State : Master
 Virtual IP : 192.168.1.254
 Master IP : 192.168.1.200
 PriorityRun : 110
 PriorityConfig : 110
 MasterPriority : 110
 Preempt : YES Delay Time : 0 s
 TimerRun : 1 s
 TimerConfig : 1 s
 Auth type : NONE
 Virtual MAC : 0000-5e00-0102
 Check TTL : YES
 Config type : normal-vrrp
 Backup-forward : disabled
 Track IF : GigabitEthernet0/0/1 Priority reduced : 60
 IF state : UP
 ……

可以观察到 R1 里两个备份组切换成 Backup,R2 里两个备份组为 Master。且 R1 的 vrrp
备份组 1 优先级被裁减掉 60,变成 50,小于路由器 R2 的优先级 100。
测试 PC 访问服务器时的数据包转发路径
PC1

PC>tracert 20.20.20.2
traceroute to 20.20.20.2, 8 hops max
(ICMP), press Ctrl+C to stop
1 192.168.1.200 31 ms 47 ms 47 ms
2 30.30.30.2 47 ms 47 ms 15 ms
3 20.20.20.2 63 ms 47 ms 47 ms

PC2

PC>tracert 20.20.20.2
traceroute to 20.20.20.2, 8 hops max
(ICMP), press Ctrl+C to stop
1 192.168.1.200 31 ms 47 ms 47 ms
2 30.30.30.2 46 ms 47 ms 32 ms
3 20.20.20.2 46 ms 47 ms 63 ms

观察到数据包发送路径已经切换到 R2。文章来源地址https://www.toymoban.com/news/detail-487593.html

到了这里,关于ensp基于 VRRP 的负载均衡出口链路配置的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 实验二 VRRP配置-ensp

    1、掌握VRRP的配置方法; 2、理解VRRP的工作原理; 3、熟悉VRRP的报文格式。 根据如上图所示的配置信息分别为路由器R1和路由器R2的两个接口配置IP地址和子网掩码。 创建VRID分别为2和3的两个虚拟路由器,将路由器R1的接口1和路由器R2的接口1分配给VRID为2的虚拟路由器,并将路

    2024年02月04日
    浏览(28)
  • VRRP原理及ensp配置教程

    目录 1 VRRP作用 1.1VRRP实现原理 2实验拓扑 2.1配置pc机IP  2.2配置路由器 2.3实验测试 VRRP协议中文名称虚拟路由冗余协议,应用在路由器上,其作用是某一路由器损坏或链路出现问题立刻切换到另一个路由器上不影响整个网络的运行,更好的保障网络通信 Server服务器为PC2与PC3提

    2024年02月05日
    浏览(54)
  • eNSP模拟器下VRRP+MSTP实验配置

    ①: 底层配置: vlan trunk 略 ②:MSTP配置: 所有交换机:                   stp region-configuration                 region-name aa                 revision-level 1                 instance 1 vlan 2 to 3                 instance 2 vlan 4 to 5           

    2024年02月04日
    浏览(32)
  • 在华为eNSP中配置VRRP与MSTP协议

    (1)VRRP(Virtual Router Redundancy Protocol)的概念:   VRRP(Virtual Router Redundancy Protocol)指的是一种实现路由器冗余备份的协议,常用于构建局域网内的高可用性、无故障转移的网络拓扑。通过使用 VRRP,可以将多个路由器构成一个虚拟路由器,对外提供单一的虚拟 IP 地址和 MA

    2024年01月17日
    浏览(29)
  • 基于 CentOS 7 构建 LVS-DR 群集,配置nginx负载均衡。

    基于 CentOS 7 构建 LVS-DR 群集。 关闭防火墙 [root@localhost ~]# systemctl stop firewalld 安装ifconfig yum install net-tools.x86_64 -y 准备四台虚拟机 IP 用途 19.168.244.144 客户端 192.168.244.145 lvs 192.168.244.148 RS 192.168.244.149 RS 在DS上 配置LVS虚拟IP 安装ipvsadm yum install ipvsadm -y 增加IP ifconfig ens33:200 192.1

    2024年02月11日
    浏览(24)
  • 基于 CentOS 7 构建 LVS-DR 群集。配置nginx负载均衡。

    1、基于 CentOS 7 构建 LVS-DR 群集。   2、配置nginx负载均衡。

    2024年02月11日
    浏览(25)
  • 基于 CentOS 7 构建 LVS-DR 群集 && 配置nginx负载均衡

    RHCE 客户机 192.168.100.146 node1 lvs 192.168.100.145 node2 RS 192.168.100.147 node3 RS 192.168.100.148 [root@node1 ~]# yum install ipvsadm.x86_64 [root@node2 ~]# yum install http -y         [root@node2 ~]# systemctl start httpd [root@node3 ~]# yum install http -y [root@node3 ~]# systemctl start httpd [root@node1 ~]# ifconfig ens33:200 192.168.1

    2024年02月13日
    浏览(21)
  • nginx配置负载均衡--实战项目(适用于轮询、加权轮询、ip_hash)

    👨‍🎓 博主简介   🏅云计算领域优质创作者   🏅华为云开发者社区专家博主   🏅阿里云开发者社区专家博主 💊 交流社区: 运维交流社区 欢迎大家的加入! 🐋 希望大家多多支持,我们一起进步!😄 🎉如果文章对你有帮助的话,欢迎 点赞 👍🏻 评论 💬 收藏

    2024年02月08日
    浏览(29)
  • 基于 CentOS 7 构建 LVS-DR 集群 及 配置nginx负载均衡

    Node01:PC Node02:LVS Node03、Node04:Webserver 2.1 在Node02上配置 2.1.1 安装ipvsadm管理软件按  2.1.2 配置VIP 2.2 在Node03上配置 2.2.1 安装Apache服务 2.2.2 编辑默认主页  2.3 在Node04配置  2.3.1 安装Apache服务 2.3.2 编辑默认主页 2.4 在Node01上测试 3.1 在Node03上配置 3.2 在Node04行配置 4.1 在Node0

    2024年02月14日
    浏览(34)
  • 基于 CentOS 7 构建 LVS-DR 群集以及配置nginx负载均衡

    目录 一、基于 CentOS 7 构建 LVS-DR 群集 1、前期准备 1、关闭防火墙 2、安装ifconfig 3、准备四台虚拟机 2、在DS上 2.1、配置LVS虚拟IP 2.2、手工执行配置添加LVS服务并增加两台RS 2.3、查看配置 3、在RS端(第三台、第四台) 上 3.1、配置Web服务器 3.2、配置默认主页 3.3、启动服务 3

    2024年02月13日
    浏览(36)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包