CCNA培训课总结笔记--RIPv1负载均衡(六)

简介:
实验目的:
验证 RIP 负载均衡 , RIP 的负载均衡是由跳数决定 , 如果跳数相同则起到负载均衡 .
实验拓扑图:
实验内容:
路由器的基本配置
R 上的
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
R1(config)#interface loopback 1
R1(config-if)#ip address 1.1.1.1 255.255.255.0
R1(config-if)#exit
R1(config)#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
*Mar  1 00:14:04.503: %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up
*Mar  1 00:14:05.503: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to up
R1(config-if)#ip address 172.16.2.1 255.255.255.0
R1(config-if)#clock rate 64000
R1(config-if)#no shutdown
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.
*Mar  1 00:14:57.579: %LINK-3-UPDOWN: Interface Serial1/0, changed state to up
R2(config-if)#ip address 172.16.3.1
*Mar  1 00:14:58.583: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to up
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 loopback 0
R3(config-if)#ip address 3.3.3.3 255.255.255.0
R3(config-if)#exit
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)#exit
R3(config)#interface s1/1
R3(config-if)#ip address 172.16.3.2 255.255.255.0
R3(config-if)#no shutdown
好了 , 现在开始配置 RIP
先在 R1 , 宣告接口网络
R1(config)#router rip
R1(config-router)#network 1.0.0.0
R1(config-router)#network 172.16.2.0
R1(config-router)#network 172.16.1.0
R2 上的 , 两样的格式
R2(config)#router rip
R2(config-router)#network 172.16.2.0
R2(config-router)#network 172.16.3.0
R3 上的
R3(config)#router rip
R3(config-router)#network 3.0.0.0
R3(config-router)#network 172.16.1.0
R3(config-router)#network 172.16.3.0
配置好后 , 查看一下路由表
R1 的路由表
R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
 
Gateway of last resort is not set
 
     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback1
R    3.0.0.0/8 [120/1] via 172.16.1.2, 00:00:03, Ethernet0/0
     172.16.0.0/24 is subnetted, 3 subnets
C       172.16.1.0 is directly connected, Ethernet0/0
C       172.16.2.0 is directly connected, Serial1/0
R       172.16.3.0 [120/1] via 172.16.2.2, 00:00:10, Serial1/0
                   [120/1] via 172.16.1.2, 00:00:03, Ethernet0/0
注意最后的一条 RIP 路由 , 可以看到去 172.16.3.0 的路由已经产生了负载均衡的现象 , 因为它们的跳数是相同的 .
R2 上的路由表
R2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
 
Gateway of last resort is not set
 
R    1.0.0.0/8 [120/1] via 172.16.2.1, 00:00:24, Serial1/0
R    3.0.0.0/8 [120/1] via 172.16.3.2, 00:00:03, Serial1/1
     172.16.0.0/24 is subnetted, 3 subnets
R       172.16.1.0 [120/1] via 172.16.2.1, 00:00:24, Serial1/0
                   [120/1] via 172.16.3.2, 00:00:03, Serial1/1
C       172.16.2.0 is directly connected, Serial1/0
C       172.16.3.0 is directly connected, Serial1/1
很清楚也显示了所有的链路 .
R3 的路由表
R3#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
 
Gateway of last resort is not set
 
R    1.0.0.0/8 [120/1] via 172.16.1.1, 00:00:03, Ethernet0/0
     3.0.0.0/24 is subnetted, 1 subnets
C       3.3.3.0 is directly connected, Loopback0
     172.16.0.0/24 is subnetted, 3 subnets
C       172.16.1.0 is directly connected, Ethernet0/0
R       172.16.2.0 [120/1] via 172.16.3.1, 00:00:17, Serial1/1
                   [120/1] via 172.16.1.1, 00:00:03, Ethernet0/0
C       172.16.3.0 is directly connected, Serial1/1
最后 , 用扩展的 ping 命令来测试负载均衡
先从 R1 loopback 0  接口上 pingR3 S1/1
R1#ping
Protocol [ip]:
Target IP address: 172.16.3.2
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]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.3.2, 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 (136 ms).  Received packet has options
 Total option bytes= 40, padded length=40
 Record route:
   (172.16.2.1)
   (172.16.3.1)
   (172.16.3.2)
   (172.16.1.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 (112 ms).  Received packet has options
 Total option bytes= 40, padded length=40
 Record route:
   (172.16.1.1)
   (172.16.3.2)
   (172.16.1.2)
   (1.1.1.1) <*>
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
 End of list
 
Reply to request 2 (160 ms).  Received packet has options
 Total option bytes= 40, padded length=40
 Record route:
   (172.16.2.1)
   (172.16.3.1)
   (172.16.3.2)
   (172.16.1.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 (112 ms).  Received packet has options
 Total option bytes= 40, padded length=40
 Record route:
   (172.16.1.1)
   (172.16.3.2)
   (172.16.1.2)
   (1.1.1.1) <*>
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
 End of list
 
Reply to request 4 (160 ms).  Received packet has options
 Total option bytes= 40, padded length=40
 Record route:
   (172.16.2.1)
   (172.16.3.1)
   (172.16.3.2)
   (172.16.1.2)
   (1.1.1.1) <*>
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
 End of list
可以注意到数据包的路径可以发现 , 来回的路径不同 , 也就是说数据包是走了负载均衡的 .


本文转自 独钩寒江雪 51CTO博客,原文链接:http://blog.51cto.com/bennie/101394,如需转载请自行联系原作者
相关实践学习
部署高可用架构
本场景主要介绍如何使用云服务器ECS、负载均衡SLB、云数据库RDS和数据传输服务产品来部署多可用区高可用架构。
负载均衡入门与产品使用指南
负载均衡(Server Load Balancer)是对多台云服务器进行流量分发的负载均衡服务,可以通过流量分发扩展应用系统对外的服务能力,通过消除单点故障提升应用系统的可用性。 本课程主要介绍负载均衡的相关技术以及阿里云负载均衡产品的使用方法。
相关文章
|
负载均衡 网络协议 算法
关于开发中负载均衡(代理)的一些笔记
如果能深刻理解苦难,苦难就会给人带来崇高感 。 ——路遥
151 0
关于开发中负载均衡(代理)的一些笔记
|
弹性计算 负载均衡
SLB负载均衡实践的笔记
SLB负载均衡实践:首先云服务器状态确认,然后负载均衡配置,最后负载均衡验证。
SLB负载均衡实践的笔记
|
弹性计算 负载均衡
【ECS进阶实践】Day3笔记 SLB负载均衡实践
通过使用阿里云负载均衡 SLB 以及对负载均衡 SLB 后端服务器 ECS 的权重进行修改,快速解决服务器响应速度慢的问题。
379 1
【ECS进阶实践】Day3笔记 SLB负载均衡实践
|
弹性计算 负载均衡 数据安全/隐私保护
Day3 - ECS+SLB负载均衡实践笔记
负载均衡:是将访问流量根据转发策略分发到后端多台云服务器(ECS实例)的流量分发控制服务。负载均衡扩展了应用的服务能力,增强了应用的可用性。 通过设置虚拟服务地址,将添加的ECS实例虚拟成一个高性能、高可用的应用服务池,并根据转发规则,将来自客户端的请求分发给云服务器池中的ECS实例。 架构 负载均衡服务主要有三个核心概念: 负载均衡实例:一个负载均衡实例是一个运行的负载均衡服务,用来接收流量并将其分配给后端服务器。 监听 :监听用来检查客户端请求并将请求转发给后端服务器。监听也会对后端服务器进行健康检查。 后端服务器:一组接收前端请求的ECS实例。
276 0
Day3 - ECS+SLB负载均衡实践笔记
|
负载均衡 算法 应用服务中间件
nginx笔记4-负载均衡带来的问题以及解决办法
接着笔记3,将笔记三的改造一下,现在分别启动两个Tomcat,在页面获取session。如图所示: tomcat2的session: tomcat1的session:    根据上图发现,每个tomcat取到的session不一样。
1278 0
|
负载均衡 算法 应用服务中间件
nginx笔记3-负载均衡算法
1.nginx测试:先从官网下载nginx 官网网址为:http://nginx.org/  然后找到stable version的版本下载,因为这版本是最稳定的,不要去下载最新,因为不稳定,如下图: 下载解压后即可 这里还要对解压后的nginx的conf目录下的nginx.conf配置如下图: 上图中的proxy_pass http://test-service;意思是只有test-service下面的tomcat才能通过我的反向代理。
1040 0
|
负载均衡 算法 网络安全
|
负载均衡 算法 Linux
Linux负载均衡专题(个人心得和笔记按照下面的步骤就能建立可用的集群)
http://www.askwan.com/post/28/ haproxy+keepalived   Linux企业集群 http://book.
1201 0
|
关系型数据库 MySQL Linux
mysql负载均衡笔记
http://dev.mysql.com/doc/refman/5.1/zh/ndbcluster.
837 0