设为首页收藏本站language 语言切换
查看: 1792|回复: 1
收起左侧

RIP实现等开销负载均衡的配置

[复制链接]
发表于 2010-8-23 22:16:52 | 显示全部楼层 |阅读模式
实验说明:通过使用debug命令基于每个分组和每个目的地来考察等开销负载均衡。 
3.png

实验配置:
r1#sh runinterface 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 runinterface 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 runinterface 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 routeCodes: 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 routeGateway of last resort is not setR    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, Serial1C    192.168.1.0/24 is directly connected, Serial0C    192.168.2.0/24 is directly connected, Serial1C    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升级后再进行验证。
发表于 2013-4-19 16:32:44 | 显示全部楼层
沙发 2013-4-19 16:32:44 回复 收起回复
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 论坛注册

本版积分规则

QQ|Archiver|手机版|小黑屋|sitemap|鸿鹄论坛 ( 京ICP备14027439号 )  

GMT+8, 2025-2-3 18:56 , Processed in 0.059677 second(s), 14 queries , Redis On.  

  Powered by Discuz!

  © 2001-2025 HH010.COM

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