<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

 
4.1 IGRP 的实现

 

实验连接图

<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" />

提要描述

IGRP(Interior Gateway Routing Protocol) 内部网关路由协议是八十年代中期由 Cisco 公司开发的路由协议, Cisco 创建 IGRP 的主要目的是为 AS 内的路由提供一种健壮的协议。

八十年代中期,最流行的 AS 内的路由协议是 RIP 。虽然 RIP 对于在小到中型的同类网中非常有用,但随着网络的发展, 其限制越来越显著,特别是 RIP 很小的跳数限制 (16) 制约了网络的规模,且其单一的 metric (跳数)在复杂的环境中很不灵活。 Cisco 路由器的普及和 IGRP 的健壮性使许多拥有大型网络的组织用 IGRP 代替 RIP

   Cisco 最初的 IGRP 实现工作在 IP 网络上,但是 IGRP 是设计以运行于任何网络环境中的, Cisco 很快就把它移植以运行于 OSI CLNP(Connectionless Network Protocol) 网络。 在九十年代初 Cisco 开发了增强型 IGRP EIGRP )以提高 IGRP 的工作效率,现在 Cisco 只有在较低的 IOS 版本才支持 IGRP 。本文讨论 IGRP 的基本配置和实现。

实验目标: IGRP 的基本配置、定时器设置、被动接口、单播更新、非等价负载均衡。

↓调试配置及监测步骤↓

 

 

 

4.1.1 IGRP基本配置

R1 的配置

R2 的配置

!

hostname R1

!

interface Loopback0

 ip address 1.1.1.1 255.255.255.0

!

interface Serial1/1

 ip address 12.1.1.1 255.255.255.0

 no shut

!

router igrp 100

 network 1.0.0.0

 network 12.0.0.0

!

!

hostname R2

!

interface Serial1/0

 ip address 12.1.1.2 255.255.255.0

 no shut

!

interface Serial1/1

 ip address 23.1.1.2 255.255.255.0

 no shut

!

router igrp 100

 network 12.0.0.0

 network 23.0.0.0

R3 的配置

 
!

hostname R3

!

interface Loopback0

 ip address 3.3.3.3 255.255.255.0

!

interface Serial1/0

 ip address 23.1.1.3 255.255.255.0

 no shut

!        

router igrp 100

 network 3.0.0.0

 network 23.0.0.0

!

 

 

配置IGRP的时候,它的自治系统号(Autonomous system number)必须一致,否则路由器之间不会交换路由信息。

 

下面看看各个路由器的路由表:

 

R1#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />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, 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, Loopback0

I    3.0.0.0/8 [100/10976] via 12.1.1.2, 00:00:56, Serial1/1

I    23.0.0.0/8 [100/10476] via 12.1.1.2, 00:00:56, Serial1/1

     12.0.0.0/24 is subnetted, 1 subnets

C       12.1.1.0 is directly connected, Serial1/1

 

R2#show ip route

I    1.0.0.0/8 [100/8976] via 12.1.1.1, 00:00:36, Serial1/0

I    3.0.0.0/8 [100/8976] via 23.1.1.3, 00:00:32, Serial1/1

     23.0.0.0/24 is subnetted, 1 subnets

C       23.1.1.0 is directly connected, Serial1/1

     12.0.0.0/24 is subnetted, 1 subnets

C       12.1.1.0 is directly connected, Serial1/0

 

R3#show ip route

I    1.0.0.0/8 [100/10976] via 23.1.1.2, 00:01:03, Serial1/0

     3.0.0.0/24 is subnetted, 1 subnets

C       3.3.3.0 is directly connected, Loopback0

     23.0.0.0/24 is subnetted, 1 subnets

C       23.1.1.0 is directly connected, Serial1/0

I    12.0.0.0/8 [100/10476] via 23.1.1.2, 00:01:03, Serial1/0

由结果可以看到,各个路由器都已经学到前面IIGRP的路由条目。

 

 

下面以R1为例,用debug ip igrp transactions命令来监测路由信息的更新情况:

 

R1#debug ip igrp transactions

00:19:52: IGRP: received update from 12.1.1.2 on Serial1/1

00:19:52:       network 3.0.0.0, metric 10976 (neighbor 8976)

00:19:52:       network 23.0.0.0, metric 10476 (neighbor 8476)

R1#

00:20:31: IGRP: sending update to 255.255.255.255 via Serial1/1 (12.1.1.1)

00:20:31:       network 1.0.0.0, metric=501

00:20:31: IGRP: sending update to 255.255.255.255 via Loopback0 (1.1.1.1)

00:20:31:       network 3.0.0.0, metric=10976

00:20:31:       network 23.0.0.0, metric=10476

00:20:31:       network 12.0.0.0, metric=8476

从输出信息可以开到R1S1/1接口学到的路由条目,不会再由S1/1接口发送出去,这证明IGRP的水平分割在起作用,IGRP水平分割的作用与RIP中的一样,路由器学习到路由信息,不会向发来信息的接口返回同样的信息。

 

下面在R1S1/1接口关闭水平分割功能看看:

 

R1(config)#int s1/1

R1(config-if)#no ip split-horizon

 

R1#debug ip igrp transactions

00:28:06: IGRP: received update from 12.1.1.2 on Serial1/1

00:28:06:       network 3.0.0.0, metric 10976 (neighbor 8976)

00:28:06:       network 23.0.0.0, metric 10476 (neighbor 8476)

R1#

00:28:56: IGRP: sending update to 255.255.255.255 via Serial1/1 (12.1.1.1)

00:28:56:       subnet 12.1.1.0, metric=8476

00:28:56:       network 1.0.0.0, metric=501

00:28:56:       network 3.0.0.0, metric=10976

00:28:56:       network 23.0.0.0, metric=10476

由结果可以看到,关闭水平分割之后,从同一个接口学到的路由又这个接口发送出去。

 

下面验证一下IGRP自治系统号不一致的情况,在R1上删除IGRP原来的进程,并添加一个新的自治系统号为10的进程。

 

R1(config)#no router igrp 100

R1(config)#router igrp 10

R1(config-router)#network 1.0.0.0

R1(config-router)#network 12.0.0.0

 

R1#show ip route

     1.0.0.0/24 is subnetted, 1 subnets

C       1.1.1.0 is directly connected, Loopback0

     12.0.0.0/24 is subnetted, 1 subnets

C       12.1.1.0 is directly connected, Serial1/1

R1的路由表可以看到由于自治系统号的不一致导致路由器不会交换路由信息

 

 

4.1.2 IGRP的定时器设置

默认情况下IGRP的定时器情况:

 

R2#show ip protocols

Routing Protocol is "igrp 100"

  Sending updates every 90 seconds, next due in 28 seconds

  Invalid after 270 seconds, hold down 280, flushed after 630

  Outgoing update filter list for all interfaces is not set

  Incoming update filter list for all interfaces is not set

  Default networks flagged in outgoing updates

  Default networks accepted from incoming updates

  IGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0

  IGRP maximum hopcount 100

  IGRP maximum metric variance 1

  Redistributing: igrp 100

  Maximum path: 4

  Routing for Networks:

    12.0.0.0

    23.0.0.0

  Routing Information Sources:

    Gateway         Distance      Last Update

    12.1.1.1             100      00:06:48

    23.1.1.3             100      00:00:45

  Distance: (default is 100)

 

 

由于默认定时器时间太长,我们可以在IGRP路由进程下通过命令timers basic X X X X 来修改相应的时间值。

 

先在R1上删除IGRP进程,恢复自治系统号为100的进程。

 

R1(config)#no router igrp 10

R1(config)#router igrp 100

R1(config-router)#network 1.0.0.0

R1(config-router)#network 12.0.0.0

 

现在各路由器上修改定时器的时间:

R1(config)#router igrp 100

R1(config-router)#timers basic 10 20 30 40

R1#clear ip route *

 

R2(config)#router igrp 100

R2(config-router)#timers basic 10 20 30 40

R1#clear ip route *

 

R3(config)#router igrp 100

R3(config-router)#timers basic 10 20 30 40

R1#clear ip route *

 

R1#show ip protocols

Routing Protocol is "igrp 100"

  Sending updates every 10 seconds, next due in 6 seconds

  Invalid after 20 seconds, hold down 30, flushed after 40

  Outgoing update filter list for all interfaces is not set

  Incoming update filter list for all interfaces is not set

  Default networks flagged in outgoing updates

  Default networks accepted from incoming updates

  IGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0

  IGRP maximum hopcount 100

  IGRP maximum metric variance 1

  Redistributing: igrp 100

  Maximum path: 4

  Routing for Networks:

    1.0.0.0

    12.0.0.0

  Routing Information Sources:

    Gateway         Distance      Last Update

    12.1.1.2             100      00:00:01

  Distance: (default is 100)

通过以R1为例在show ip protocols下可以看到各定时器已经修改成功,当然我们还可以通过debug ip igrp transactions和多次重复show ip route 来监测查看定时器的情况(也可以shutdown接口测试接收不到路由信息的情况)。

 

 

 

4.1.3 IGRP的被动接口情况

 

R2上禁止S1/1接口发送IGRP路由更新:

R2(config)#router igrp 100

R2(config-router)#passive-interface s1/1   

 

R2#debug ip igrp transactions

01:12:38: IGRP: sending update to 255.255.255.255 via Serial1/0 (12.1.1.2)

01:12:38:       network 3.0.0.0, metric=8976

01:12:38:       network 23.0.0.0, metric=8476

R2#

01:12:39: IGRP: received update from 12.1.1.1 on Serial1/0 #---接收来自R1

01:12:39:       network 1.0.0.0, metric 8976 (neighbor 501)

R2#

01:12:41: IGRP: received update from 23.1.1.3 on Serial1/1 #---接收来自R3

01:12:41:       network 3.0.0.0, metric 8976 (neighbor 501)

R2#

01:12:48: IGRP: sending update to 255.255.255.255 via Serial1/0 (12.1.1.2)

01:12:48:       network 3.0.0.0, metric=8976

01:12:48:       network 23.0.0.0, metric=8476

debug信息可以开到,来自R1R3的路由信息R2都接收了,而且R2把接收到来自R3的路由信息由接口S1/0发送给R1,但却不把接收到来自R1的路由信息由S1/1发送给R3,这就是S1/1做了被动起到的作用(只收不发)

 

再看看R1R3的路由表:

 

R1#show ip route

     1.0.0.0/24 is subnetted, 1 subnets

C       1.1.1.0 is directly connected, Loopback0

I    3.0.0.0/8 [100/10976] via 12.1.1.2, 00:00:02, Serial1/1

I    23.0.0.0/8 [100/10476] via 12.1.1.2, 00:00:02, Serial1/1

     12.0.0.0/24 is subnetted, 1 subnets

C       12.1.1.0 is directly connected, Serial1/1

 

R3#show ip route

     3.0.0.0/24 is subnetted, 1 subnets

C       3.3.3.0 is directly connected, Loopback0

     23.0.0.0/24 is subnetted, 1 subnets

C       23.1.1.0 is directly connected, Serial1/0

由两个路由表可以看到,R1学到了R2发来的全部路由,但R3没有学到。

 

 

 

4.1.4 IGRP的单播更新

 

R1 的配置

R2 的配置

!

hostname R1

!

interface Loopback0

 ip address 1.1.1.1 255.255.255.0

!

interface FastEthernet0/0

 ip address 10.1.1.1 255.255.255.0

no shut

!        

router igrp 10

 network 1.0.0.0

 network 10.0.0.0

!

!

hostname R2

!

interface FastEthernet0/0

 ip address 10.1.1.2 255.255.255.0

 no shut

!

router igrp 10

 network 10.0.0.0

!  

R3 的配置

 
!

hostname R3

!

interface Loopback0

 ip address 3.3.3.3 255.255.255.0

!

interface FastEthernet0/0

 ip address 10.1.1.3 255.255.255.0

no shut

!        

router igrp 10

 network 3.0.0.0

 network 10.0.0.0

!

 

 

看看R2的接收IGRP路由器信息的情况:

 

R2#show ip route

I    1.0.0.0/8 [100/610] via 10.1.1.1, 00:00:06, FastEthernet0/0

I    3.0.0.0/8 [100/610] via 10.1.1.3, 00:00:06, FastEthernet0/0

     10.0.0.0/24 is subnetted, 1 subnets

C       10.1.1.0 is directly connected, FastEthernet0/0

 

R2#debug ip igrp transactions

00:13:47: IGRP: received update from 10.1.1.3 on FastEthernet0/0

00:13:47:       network 3.0.0.0, metric 610 (neighbor 501)

00:13:51: IGRP: received update from 10.1.1.1 on FastEthernet0/0

00:13:51:       network 1.0.0.0, metric 610 (neighbor 501)

R2Fa0/0接口接收到,分别来自R1R3的路由信息。

 

下面在R1R3上配置单播更新看看:

 

R1(config)#router igrp 10

R1(config-router)#neighbor 10.1.1.3  #----指定R3为单播邻居

 

R3(config)#router igrp 10

R3(config-router)#neighbor 10.1.1.1  #----知道R1为单播邻居

 

R1#debug ip igrp events

00:19:11: IGRP: sending update to 255.255.255.255 via FastEthernet0/0 (10.1.1.1) #---虽然做了单播,但仍然向F0/0发送广播更新

00:19:11: IGRP: Update contains 0 interior, 1 system, and 0 exterior routes.

00:19:11: IGRP: Total routes in update: 1

00:19:11: IGRP: sending update to 255.255.255.255 via Loopback0 (1.1.1.1) #----Loopback0接口发送广播更新

00:19:11: IGRP: Update contains 0 interior, 2 system, and 0 exterior routes.

00:19:11: IGRP: Total routes in update: 2

00:19:11: IGRP: sending update to 10.1.1.3 via FastEthernet0/0 (10.1.1.1) #----R3发送单播更新

00:19:11: IGRP: Update contains 1 interior, 1 system, and 0 exterior routes.

00:19:11: IGRP: Total routes in update: 2

00:19:12: IGRP: received update from 10.1.1.3 on FastEthernet0/0  #----收到来自R3的单播更新

00:19:12: IGRP: Update contains 0 interior, 1 system, and 0 exterior routes.

00:19:12: IGRP: Total routes in update: 1

通过debug信息我们可以看到R1R3之间已经建立了单播更新。

 

我都知道在RIP当中单播可以穿透被动接口发送消息出去,那现在我们看看在IGRP的情况又会如何!?

 

R1Fa0/0被动掉:

R1(config)#router igrp 10

R1(config-router)#passive-interface fa0/0

 

看看R2R3的路由表

 

R2#show ip route

I    1.0.0.0/8 [100/610] via 10.1.1.1, 00:02:54, FastEthernet0/0

I    3.0.0.0/8 [100/610] via 10.1.1.3, 00:00:37, FastEthernet0/0

     10.0.0.0/24 is subnetted, 1 subnets

C       10.1.1.0 is directly connected, FastEthernet0/0

 

R2#show ip route

I    1.0.0.0/8 is possibly down, routing via 10.1.1.1, FastEthernet0/0

I    3.0.0.0/8 [100/610] via 10.1.1.3, 00:00:34, FastEthernet0/0

     10.0.0.0/24 is subnetted, 1 subnets

C       10.1.1.0 is directly connected, FastEthernet0/0

 

R3#show ip route

I    1.0.0.0/8 [100/610] via 10.1.1.1, 00:00:44, FastEthernet0/0

     3.0.0.0/24 is subnetted, 1 subnets

C       3.3.3.0 is directly connected, Loopback0

     10.0.0.0/24 is subnetted, 1 subnets

C       10.1.1.0 is directly connected, FastEthernet0/0

R2的路由表可以看到,学到来自R1的路由条目老化时间已经超过了90S,这证明R2已经再没有收到相关的路由更新了,而R3依然正常接收更新。这是因为我们在R1Fa0/0接口上做了被动,这时R1Fa0/0对路由信息是(只收不发),但又因为R1R3之间做了指定了单播邻居。做了单播更新,R1照常向R3发送更新,所以R3正常地接收来自R1的路由更新。这也说明了单播更新在IGRP中也可以穿透被动接口。

debug信息也可以证明这点:

R1#debug ip igrp transactions

00:35:20: IGRP: received update from 10.1.1.3 on FastEthernet0/0

00:35:20:       network 3.0.0.0, metric 610 (neighbor 501)

00:35:20: IGRP: received update from 10.1.1.3 on FastEthernet0/0

00:35:20:       subnet 10.1.1.0, metric 120 (neighbor 110)

00:35:20:       network 3.0.0.0, metric 610 (neighbor 501)

R1#

00:35:32: IGRP: sending update to 255.255.255.255 via Loopback0 (1.1.1.1)

00:35:32:       network 3.0.0.0, metric=610

00:35:32:       network 10.0.0.0, metric=110

00:35:32: IGRP: sending update to 10.1.1.3 via FastEthernet0/0 (10.1.1.1)

00:35:32:       subnet 10.1.1.0, metric=110

00:35:32:       network 1.0.0.0, metric=501

Debug信息中,可以看到R1再也不向Fa0/0发送广播更新了,只向Lo0接口发送广播更新和向R3发送单播更新。

 

 

4.1.5 IGRP的非等价负载均衡

R1 的配置

R2 的配置

!

hostname R1

!

interface Loopback0

 ip address 1.1.1.1 255.255.255.0

!

interface FastEthernet0/0

 ip address 10.1.1.1 255.255.255.0

no shut

!

interface Serial1/1

 ip address 12.1.1.1 255.255.255.0

no shut

!

router igrp 10

 network 1.0.0.0

 network 10.0.0.0

 network 12.0.0.0

!        

!

hostname R2

!

interface FastEthernet0/0

 ip address 10.1.1.2 255.255.255.0

 no shut

!        

interface Serial1/0

 ip address 12.1.1.2 255.255.255.0

 no shut

!

interface Serial1/1

 ip address 23.1.1.2 255.255.255.0

 no shut

!

router igrp 10

 network 10.0.0.0

 network 12.0.0.0

 network 23.0.0.0

!

R3 的配置

 
!

hostname R3

!

interface Loopback0

 ip address 3.3.3.3 255.255.255.0

!

interface Serial1/0

 ip address 23.1.1.3 255.255.255.0

no shut

!

router igrp 10

 network 3.0.0.0

 network 23.0.0.0

!

 

 

 

完成配置之后看看各个路由器的路由表情况:

 

R1#show ip route

     1.0.0.0/24 is subnetted, 1 subnets

C       1.1.1.0 is directly connected, Loopback0

I    3.0.0.0/8 [100/8986] via 10.1.1.2, 00:01:01, FastEthernet0/0

I    23.0.0.0/8 [100/8486] via 10.1.1.2, 00:01:01, FastEthernet0/0

     10.0.0.0/24 is subnetted, 1 subnets

C       10.1.1.0 is directly connected, FastEthernet0/0

     12.0.0.0/24 is subnetted, 1 subnets

C       12.1.1.0 is directly connected, Serial1/1

 

R2#show ip route

I    1.0.0.0/8 [100/610] via 10.1.1.1, 00:00:12, FastEthernet0/0

I    3.0.0.0/8 [100/8976] via 23.1.1.3, 00:00:18, Serial1/1

     23.0.0.0/24 is subnetted, 1 subnets

C       23.1.1.0 is directly connected, Serial1/1

     10.0.0.0/24 is subnetted, 1 subnets

C       10.1.1.0 is directly connected, FastEthernet0/0

     12.0.0.0/24 is subnetted, 1 subnets

C       12.1.1.0 is directly connected, Serial1/0

 

R3#show ip route

I    1.0.0.0/8 [100/8986] via 23.1.1.2, 00:00:51, Serial1/0

     3.0.0.0/24 is subnetted, 1 subnets

C       3.3.3.0 is directly connected, Loopback0

     23.0.0.0/24 is subnetted, 1 subnets

C       23.1.1.0 is directly connected, Serial1/0

I    10.0.0.0/8 [100/8486] via 23.1.1.2, 00:00:51, Serial1/0

I    12.0.0.0/8 [100/10476] via 23.1.1.2, 00:00:51, Serial1/0

结果显示各路由器都学到了相应的路由信息,而且R1R2的相互学到的路由条目是通过Fa0/0接口接收的。

 

针对以上情况,下面我们看看IGRP的度量计算公式情况:

度量标准=[K1*带宽+(K2*带宽)/(256-负载)+K3*延迟]*[K5/(可靠性+K4)]

默认的常数值是K1=K3=1K2=K4=K5=0

因此,IGRP的度量标准计算简化为:度量标准=带宽+延迟。(其中带宽BW为最小带宽,延迟DLY为所经路由器接口的延迟总和)

 

 

R1#show ip protocols

  IGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0

 

现在我们以R1接收R3loopback路由为例,看看度量值的计算情况:

 

R1#show int fa0/0

FastEthernet0/0 is up, line protocol is up

  Hardware is AmdFE, address is cc00.0f14.0000 (bia cc00.0f14.0000)

  Internet address is 10.1.1.1/24

  MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,

     reliability 255/255, txload 1/255, rxload 1/255

 

R2#show int s1/1

Serial1/1 is up, line protocol is up

  Hardware is M4T

  Internet address is 23.1.1.2/24

  MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,

     reliability 255/255, txload 1/255, rxload 1/255

 

R3#show int loopback 0

Loopback0 is up, line protocol is up

  Hardware is Loopback

  Internet address is 3.3.3.3/24

  MTU 1514 bytes, BW 8000000 Kbit, DLY 5000 usec,

     reliability 255/255, txload 1/255, rxload 1/255

从上面我们对R3loopback路由所经过的接口跟踪查询,可以发现最小带宽BW=1544 Kbit,延迟DLY总和=100+20000+5000=25100  Metric(度量值)=10^7/1544+25100/10=8986.683937823834196891191709844约等于8986 ,与R1路由表学到的3.0.0.0的路由条目度量值一致。

 

通过下面的方式查看也可以证明:

R1#show ip route 3.0.0.0

Routing entry for 3.0.0.0/8

  Known via "igrp 10", distance 100, metric 8986

  Redistributing via igrp 10

  Advertised by igrp 10 (self originated)

  Last update from 10.1.1.2 on FastEthernet0/0, 00:00:28 ago

  Routing Descriptor Blocks:

  * 10.1.1.2, from 10.1.1.2, 00:00:28 ago, via FastEthernet0/0

      Route metric is 8986, traffic share count is 1

      Total delay is 25100 microseconds, minimum bandwidth is 1544 Kbit

      Reliability 255/255, minimum MTU 1500 bytes

      Loading 1/255, Hops 1

 

R1上打开debug信息细心观察:

R1#debug ip igrp transactions

R1#

01:00:27: IGRP: received update from 10.1.1.2 on FastEthernet0/0

01:00:27:       network 3.0.0.0, metric 8986 (neighbor 8976)

#--- neighbor 8976是指邻居(R2)到达这个网络的Metric 8976

01:00:27:       network 23.0.0.0, metric 8486 (neighbor 8476)

01:00:27:       network 12.0.0.0, metric 8486 (neighbor 8476)

01:00:27: IGRP: received update from 12.1.1.2 on Serial1/1

01:00:27:       network 1.0.0.0, metric 8986 (neighbor 610)

01:00:27:       network 3.0.0.0, metric 10976 (neighbor 8976)

01:00:28:       network 23.0.0.0, metric 10476 (neighbor 8476)

01:00:28:       network 10.0.0.0, metric 8486 (neighbor 110)

细心观察debug信息可以看到,3.0.0.0这条路由信息是分别从FastEthernet0/0Serial1/1学到,但因为Metric越少越优先,所以R1的路由表安装的是来自FastEthernet0/0的路由条目。

 

我们这里的实验连接图R1R2之间是存在两条链路的,如果要实现双链路负载均衡,可以做下面的相关调整。

 

R1(config)#router igrp 10

R1(config-router)#variance ?

  <1-128>  Metric variance multiplier

 

R1(config-router)#variance 2

上面的设置是调整Variance参数=2代表度量值Metric在允许的变化范围内(这里为最小度量值的2倍以内),路由器将在2条链路上进行负载均衡。

 

现在看看R1的路由表:

R1#show ip route

     1.0.0.0/24 is subnetted, 1 subnets

C       1.1.1.0 is directly connected, Loopback0

I    3.0.0.0/8 [100/8986] via 10.1.1.2, 00:00:09, FastEthernet0/0

               [100/10976] via 12.1.1.2, 00:00:09, Serial1/1

I    23.0.0.0/8 [100/8486] via 10.1.1.2, 00:00:09, FastEthernet0/0

                [100/10476] via 12.1.1.2, 00:00:09, Serial1/1

     10.0.0.0/24 is subnetted, 1 subnets

C       10.1.1.0 is directly connected, FastEthernet0/0

     12.0.0.0/24 is subnetted, 1 subnets

C       12.1.1.0 is directly connected, Serial1/1

可以看到3.0.0.0路由条目已经具备了2个下一跳,分别由Fa0/0S1/1学到这条路由。

 

再通过下面的工具测试一下负载均衡:

 

R1#traceroute 3.3.3.3

Type escape sequence to abort.

Tracing the route to 3.3.3.3

  1 10.1.1.2 52 msec

 12.1.1.2 72 msec

    10.1.1.2 72 msec

  2 23.1.1.3 144 msec *  216 msec

走两条路径

 

R1#show ip route 3.3.3.3

Routing entry for 3.0.0.0/8

  Known via "igrp 10", distance 100, metric 8986

  Redistributing via igrp 10

  Advertised by igrp 10 (self originated)

  Last update from 12.1.1.2 on Serial1/1, 00:00:02 ago

  Routing Descriptor Blocks:

  * 10.1.1.2, from 10.1.1.2, 00:00:02 ago, via FastEthernet0/0

      Route metric is 8986, traffic share count is 60

      Total delay is 25100 microseconds, minimum bandwidth is 1544 Kbit

      Reliability 255/255, minimum MTU 1500 bytes

      Loading 1/255, Hops 1

    12.1.1.2, from 12.1.1.2, 00:00:02 ago, via Serial1/1

      Route metric is 10976, traffic share count is 49

      Total delay is 45000 microseconds, minimum bandwidth is 1544 Kbit

      Reliability 255/255, minimum MTU 1500 bytes

      Loading 1/255, Hops 1

由于Metric的不同,traffic share count也不同,以上的接口是轮着交替发送报文的,一个发完交给下一个接口。
 
 
注意!IGRP已经是淘汰再淘汰的产物,Cisco自己现时较新版本的IOS也不再支持,所以纯粹当作实验一下研究看看效果而已。