CCNA培训课总结笔记--静态路由实现负载均衡(四)

本文涉及的产品
传统型负载均衡 CLB,每月750个小时 15LCU
网络型负载均衡 NLB,每月750个小时 15LCU
EMR Serverless StarRocks,5000CU*H 48000GB*H
简介:

实验目的:

利用静态路由实现的负载均衡 , 理解负载均衡中数据传输的过程 .
实验拓扑图:
路由器上的配置:
R1  上的配置 :
Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
粘贴上路由器的基本命令
Router(config)#enable password cisco
Router(config)#no ip domain-lookup
Router(config)#line con 0
Router(config-line)# exec-timeout 0 0
Router(config-line)# logging synchronous
Router(config-line)#
Router(config-line)#line aux 0
Router(config-line)# exec-timeout 0 0
Router(config-line)# logging synchronous
Router(config-line)#line vty 0 4
Router(config-line)#
Router(config-line)#
Router(config-line)# exec-timeout 0 0
Router(config-line)# password cisco
Router(config-line)#
Router(config-line)# login
Router(config-line)#
Router(config-line)#
Router(config-line)#alias exec a sh ip int bri
Router(config)#alias exec b sh ip route
Router(config)#alias exec c sh ip route rip
Router(config)#alias exec d sh run
Router(config)#hostname R1
设置环回测试接口 , 环回测试的主要意义在于这种接口由于是逻辑存在 , 所以这种接口永远也不会被 shutdown. 一般用来作测试和定义路由 ID 中使用 .
R1(config)#interface loopback 0,
R1(config-if)#ip address 1.1.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#interface e0/0
R1(config-if)#ip address 172.16.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface s1/0
R1(config-if)#ip address 172.16.2.1 255.255.255.0
R1(config-if)#clock rate 64000
R1(config-if)#no shutdown
R1(config-if)#exit
R2 的配置 :
Router(config)#hostname R2
R2(config)#interface s1/0
R2(config-if)#ip address 172.16.2.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface s1/1
R2(config-if)#ip address 172.16.3.1 255.255.255.0
R2(config-if)#clock rate 64000
R2(config-if)#no shutdown
R2(config-if)#exit
R3 的配置 :
Router(config)#hostname R3
R3(config)#interface e0/0
R3(config-if)#ip address 172.16.1.2 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#interface s1/1
R3(config-if)#ip address 172.16.3.2 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#interface loopback 0
R3(config-if)#ip address 4.4.4.4 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
好了 , 配置好了上面的这些之后就可以进行验证了 .
首先在路由器上设置去往 R3 的包的路径 :
R1 上的 , 直接通过静态路由来实现
R1(config)#ip route 4.4.4.0 255.255.255.0 172.16.1.2
再利用默认路由设置 R3 R1 的回包路径
R2(config)#ip route 0.0.0.0 0.0.0.0 172.16.2.1
R3(config)#ip route 0.0.0.0 0.0.0.0 172.16.3.1
在这里验证负载均衡 .
用扩展的 ping 命令
R1#ping
Protocol [ip]:
Target IP address: 4.4.4.4
Repeat count [5]:
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface: 1.1.1.1
Type of service [0]: .
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]: r
Number of hops [ 9 ]:
Loose, Strict, Record, Timestamp, Verbose[RV]: r
% No room for that option
Loose, Strict, Record, Timestamp, Verbose[RV]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
Packet has IP options:  Total option bytes= 39, padded length=40
 Record route: <*>
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
 
Reply to request 0 (112 ms).  Received packet has options
 Total option bytes= 40, padded length=40
 Record route:
   (172.16.1.1)
   (4.4.4.4)
   (172.16.3.2)
   (172.16.2.2)
   (1.1.1.1) <*>
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
 End of list
 
Reply to request 1 (184 ms).  Received packet has options
 Total option bytes= 40, padded length=40
 Record route:
   (172.16.1.1)
   (4.4.4.4)
   (172.16.3.2)
   (172.16.2.2)
   (1.1.1.1) <*>
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
 End of list
 
Reply to request 2 (136 ms).  Received packet has options
 Total option bytes= 40, padded length=40
 Record route:
   (172.16.1.1)
   (4.4.4.4)
   (172.16.3.2)
   (172.16.2.2)
   (1.1.1.1) <*>
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
 End of list
 
Reply to request 3 (136 ms).  Received packet has options
 Total option bytes= 40, padded length=40
 Record route:
   (172.16.1.1)
   (4.4.4.4)
   (172.16.3.2)
   (172.16.2.2)
   (1.1.1.1) <*>
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
 End of list
 
Reply to request 4 (136 ms).  Received packet has options
 Total option bytes= 40, padded length=40
 Record route:
   (172.16.1.1)
   (4.4.4.4)
   (172.16.3.2)
   (172.16.2.2)
   (1.1.1.1) <*>
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
 End of list
 
Success rate is 100 percent (5/5), round-trip min/avg/max = 112/140/184 ms
R1#
通过观察可以看到通过扩展 ping 命令发现 ICMP 包去回的路径是不同的这样就实现的了负载均衡 .
 


本文转自 独钩寒江雪 51CTO博客,原文链接:http://blog.51cto.com/bennie/100612,如需转载请自行联系原作者
相关实践学习
SLB负载均衡实践
本场景通过使用阿里云负载均衡 SLB 以及对负载均衡 SLB 后端服务器 ECS 的权重进行修改,快速解决服务器响应速度慢的问题
负载均衡入门与产品使用指南
负载均衡(Server Load Balancer)是对多台云服务器进行流量分发的负载均衡服务,可以通过流量分发扩展应用系统对外的服务能力,通过消除单点故障提升应用系统的可用性。 本课程主要介绍负载均衡的相关技术以及阿里云负载均衡产品的使用方法。
相关文章
|
4月前
|
负载均衡 应用服务中间件 开发工具
技术笔记:nginx和keeplive实现负载均衡高可用
技术笔记:nginx和keeplive实现负载均衡高可用
|
5月前
|
负载均衡 算法 应用服务中间件
【微服务系列笔记】负载均衡
本文介绍了负载均衡的概念和重要性,指出随着流量增长,通过垂直扩展和水平扩展来提升系统性能,其中水平扩展引入了负载均衡的需求。负载均衡的目标是将流量分布到多台服务器以提高响应速度和可用性,常见的硬件和软件负载均衡器包括F5、A10、Nginx、HAProxy和LVS等。 文章接着提到了Ribbon,这是一个客户端实现的负载均衡器,用于Spring Cloud中。Ribbon在发起REST请求时进行拦截,根据预设的负载均衡算法(如随机算法)选择服务器,并重构请求URI。文中还介绍了如何通过代码和配置文件两种方式自定义Ribbon的负载均衡策略。
244 3
|
5月前
|
网络虚拟化 网络架构
网工记背命令(7)----静态路由(负载分担,主备备份)
网工记背命令(7)----静态路由(负载分担,主备备份)
44 0
|
5月前
|
网络虚拟化 网络架构
静态路由实现路由负载分担
配置思路 采用如下的思路配置静态路由实现路由负载分担: 1. 创建VLAN并配置各接口所属VLAN,配置各VLANIF接口的IP地址。 2. 配置数据流来回两个方向的静态路由。 3. 在各主机上配置IP地址和默认网关。
|
缓存 负载均衡 算法
Nginx实现负载均衡(整合SpringBoot小demo)
Nginx实现负载均衡(整合SpringBoot小demo)
351 4
Nginx实现负载均衡(整合SpringBoot小demo)
|
负载均衡 Linux 调度
使用keepalived(HA)+LVS实现高可用负载均衡群集,调度器的双机热备
使用keepalived(HA)+LVS实现高可用负载均衡群集,调度器的双机热备
184 1
使用keepalived(HA)+LVS实现高可用负载均衡群集,调度器的双机热备
|
负载均衡 网络协议 应用服务中间件
nginx实现负载均衡
nginx实现负载均衡
336 0
nginx实现负载均衡
|
弹性计算 负载均衡 Kubernetes
【视频】第四讲-负载均衡ALB+实验三-使用ALB实现灰度发布|学习笔记
快速学习【视频】第四讲-负载均衡ALB+实验三-使用ALB实现灰度发布。
774 0
【视频】第四讲-负载均衡ALB+实验三-使用ALB实现灰度发布|学习笔记
|
域名解析 tengine 负载均衡
使用nginx的负载均衡机制实现用户无感更新服务
用户请求的转发是接口服务在部署时必须要做的一步。
|
负载均衡 Java 开发者
自定义实现负载均衡|学习笔记
快速学习自定义实现负载均衡
126 0
自定义实现负载均衡|学习笔记