4.1 IGRP
的实现
|
|
实验连接图
|
|
提要描述
|
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 - 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
由结果可以看到,各个路由器都已经学到前面带
I
的
IGRP
的路由条目。
下面以
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
从输出信息可以开到
R1
由
S1/1
接口学到的路由条目,不会再由
S1/1
接口发送出去,这证明
IGRP
的水平分割在起作用,
IGRP
水平分割的作用与
RIP
中的一样,路由器学习到路由信息,不会向发来信息的接口返回同样的信息。
下面在
R1
的
S1/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
信息可以开到,来自
R1
、
R3
的路由信息
R2
都接收了,而且
R2
把接收到来自
R3
的路由信息由接口
S1/0
发送给
R1
,但却不把接收到来自
R1
的路由信息由
S1/1
发送给
R3
,这就是
S1/1
做了被动起到的作用(只收不发)
再看看
R1
、
R3
的路由表:
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)
R2
从
Fa0/0
接口接收到,分别来自
R1
、
R3
的路由信息。
下面在
R1
、
R3
上配置单播更新看看:
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
信息我们可以看到
R1
与
R3
之间已经建立了单播更新。
我都知道在
RIP
当中单播可以穿透被动接口发送消息出去,那现在我们看看在
IGRP
的情况又会如何!?
把
R1
的
Fa0/0
被动掉:
R1(config)#router igrp 10
R1(config-router)#passive-interface fa0/0
看看
R2
和
R3
的路由表
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
依然正常接收更新。这是因为我们在
R1
的
Fa0/0
接口上做了被动,这时
R1
的
Fa0/0
对路由信息是(只收不发),但又因为
R1
和
R3
之间做了指定了单播邻居。做了单播更新,
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
结果显示各路由器都学到了相应的路由信息,而且
R1
、
R2
的相互学到的路由条目是通过
Fa0/0
接口接收的。
针对以上情况,下面我们看看
IGRP
的度量计算公式情况:
度量标准
=[K1*
带宽
+(K2*
带宽
)/(256-
负载
)+K3*
延迟
]*[K5/(
可靠性
+K4)]
默认的常数值是
K1=K3=1
,
K2=K4=K5=0
。
因此,
IGRP
的度量标准计算简化为:度量标准
=
带宽
+
延迟
。(其中带宽
BW
为最小带宽,延迟
DLY
为所经路由器接口的延迟总和)
R1#show ip protocols
IGRP metric weight K1=1, K2 =0, K3=1, K4=0, K5=0
现在我们以
R1
接收
R3
的
loopback
路由为例,看看度量值的计算情况:
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
从上面我们对
R3
的
loopback
路由所经过的接口跟踪查询,可以发现最小带宽
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/0
和
Serial1/1
学到,
但因为
Metric
越少越优先
,所以
R1
的路由表安装的是来自
FastEthernet0/0
的路由条目。
我们这里的实验连接图
R1
与
R2
之间是存在两条链路的,如果要实现双链路负载均衡,可以做下面的相关调整。
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/0
与
S1/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也不再支持,所以纯粹当作实验一下研究看看效果而已。