设为首页 收藏本站
查看: 964|回复: 0

[经验分享] RIP实现等开销负载均衡的配置

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2015-1-22 08:48:28 | 显示全部楼层 |阅读模式
实验说明:通过使用debug命令基于每个分组和每个目的地来考察等开销负载均衡。
1.jpg
  实验配置:

r1#sh run
interface Ethernet0
ip address 10.0.0.1 255.255.255.0
!
interface Serial0
ip address 192.168.1.2 255.255.255.0
!
router rip
network 10.0.0.0
network 192.168.1.0
!

r2#sh run
interface Loopback0
ip address 192.168.3.2 255.255.255.0 secondary
ip address 192.168.3.1 255.255.255.0
!
interface Serial0
ip address 192.168.1.1 255.255.255.0
clockrate 64000
!
interface Serial1
ip address 192.168.2.1 255.255.255.0
clockrate 64000
!
router rip
network 192.168.1.0
network 192.168.2.0
network 192.168.3.0
!

r3#sh run
interface Ethernet0
ip address 10.0.0.2 255.255.255.0
!
interface Serial1
ip address 192.168.2.2 255.255.255.0
!
router rip
network 10.0.0.0
network 192.168.2.0
!

r2#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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    10.0.0.0/8 [120/1] via 192.168.1.2, 00:00:23, Serial0
                        [120/1] via 192.168.2.2, 00:00:19, Serial1
C    192.168.1.0/24 is directly connected, Serial0
C    192.168.2.0/24 is directly connected, Serial1
C    192.168.3.0/24 is directly connected, Loopback0
在R2的S0和S1上使用进程交换方式

r2(config)#int s0
r2(config)#no ip route-cache
r2(config)#int s1
r2(config)#no ip route-cache
r2#sh ip int s0
Serial0 is up, line protocol is up
  Internet address is 192.168.1.1/24
  Broadcast address is 255.255.255.255
  Address determined by setup command
  MTU is 1500 bytes
  Helper address is not set
  Directed broadcast forwarding is disabled
  Multicast reserved groups joined: 224.0.0.9
  Outgoing access list is not set
  Inbound  access list is not set
  Proxy ARP is enabled
  Security level is default
  Split horizon is enabled
  ICMP redirects are always sent
  ICMP unreachables are always sent
  ICMP mask replies are never sent
  IP fast switching is disabled         
  //快速交换方式已经关闭,现在为进程交换方式
  IP fast switching on the same interface is disabled
  IP Flow switching is disabled
  IP Null turbo vector
  IP multicast fast switching is disabled
  IP multicast distributed fast switching is disabled
  IP route-cache flags are None
  Router Discovery is disabled
  IP output packet accounting is disabled
  IP access violation accounting is disabled
  TCP/IP header compression is disabled
  RTP/IP header compression is disabled
  Probe proxy name replies are disabled
  Policy routing is disabled
  Network address translation is disabled
  WCCP Redirect outbound is disabled
  WCCP Redirect exclude is disabled
BGP Policy Mapping is disabled

  检验负载均衡的效果

r2#debug ip packet
r2#ping
Protocol [ip]:
Target IP address: 10.0.0.1
Repeat count [5]:
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface: 192.168.3.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]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/31/32 ms
00:59:05: IP: s=192.168.3.1 (local), d=10.0.0.1 (Serial0), len 100, sending
00:59:05: IP: s=10.0.0.1 (Serial0), d=192.168.3.1, len 100, rcvd 4
00:59:05: IP: s=192.168.3.1 (local), d=10.0.0.1 (Serial1), len 100, sending
00:59:05: IP: s=10.0.0.1 (Serial0), d=192.168.3.1, len 100, rcvd 4
00:59:05: IP: s=192.168.3.1 (local), d=10.0.0.1 (Serial0), len 100, sending
00:59:05: IP: s=10.0.0.1 (Serial0), d=192.168.3.1, len 100, rcvd 4
00:59:05: IP: s=192.168.3.1 (local), d=10.0.0.1 (Serial1), len 100, sending
00:59:05: IP: s=10.0.0.1 (Serial0), d=192.168.3.1, len 100, rcvd 4
00:59:05: IP: s=192.168.3.1 (local), d=10.0.0.1 (Serial0), len 100, sending
00:59:05: IP: s=10.0.0.1 (Serial0), d=192.168.3.1, len 100, rcvd 4

  经过仔细的查找,终于找到了ping请求和应答产生的debug信息。查找分组发送时所经过的接口,我们看到R2的S0和S2被交替使用,可见RIP已经实现负载均衡。
 刚才我们注意到ping产生的debug信息和路由更新等产生的debug信息混杂在一起,非常不利于我们的查看,要让debug仅仅输出ping产生的信息,就要使用ACL匹配debug一起使用。

r2(config)#access-list 101 permit icmp any 10.0.0.0 0.255.255.255
r2#debug ip packet 101        /只显示匹配ACL101的debug信息
r2#ping 10.0.0.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 36/36/40 ms
r2#
01:21:52: IP: s=192.168.2.1 (local), d=10.0.0.1 (Serial1), len 100, sending
01:21:52: IP: s=192.168.1.1 (local), d=10.0.0.1 (Serial0), len 100, sending
01:21:52: IP: s=192.168.2.1 (local), d=10.0.0.1 (Serial1), len 100, sending
01:21:52: IP: s=192.168.1.1 (local), d=10.0.0.1 (Serial0), len 100, sending
01:21:52: IP: s=192.168.2.1 (local), d=10.0.0.1 (Serial1), len 100, sending

  可以看到现在debug信息只会显示Ping所产生的信息,并且目的地为10.0.0.0的ping 命令。

  以上验证了基于分组的负载均衡(在S0和S1上启用进程交换方式,强制路由器为每一个要进行的分组在路由表中查找目的网络)。下面的来验证基于目的地的负载均衡(在s0和s1上启用快速交换方式,路由器仅仅为第一个分组进行路由表查找,然后路由器把查找结果存于高速缓存中,之后的分组都按照缓存中的信息进行转发)。

r2(config)#int s0
r2(config-if)#ip route-cache
r2(config-if)#int s1
r2(config-if)#ip route-cache

  由于本路由器的ios版本不支持快速交换方式,因此看不出这个实验效果,待以后对IOS升级后再进行验证。


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-41268-1-1.html 上篇帖子: rip等价负载均衡 下篇帖子: 使用思科4507交换机引擎上的万兆模块
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表