一、背景
   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的工作效率,本文讨论IGRP的基
本设计和实现。
二、IGRP协议特性
  IGRP是一种距离向量型的内部网关协议(IGP)。 距离向量路由协议要求每个路由器
以规则的时间间隔向其相邻的路由器发送其路由表的全部或部分。随着路由信息在网络上
扩散, 路由器就可以计算到所有节点的距离。
  IGRP使用一组metric的组合(向量),网络延迟、带宽、可靠性和负载都被用于路由
选择,网管可以为每种metric设置权值, IGRP可以用管理员设置的或缺省的权值来自动计
算最佳路由。 IGRP为其metric提供了较宽的值域。例如, 可靠性和负载可在1和255之间
取值; 带宽值域为1200bps到10吉(千兆)bps;延迟可取值1到24。宽的值域可以提供满
意的metric设置,更重要的是, metric各组件以用户定义的算法结合,因此,网管可以以
直观的方式影响路由选择。
  为了提供更多的灵活性,IGRP允许多路径路由。两条等带宽线路可以以循环(round-
robin)方式支持一条通信流, 当一条线路断掉时自动切换到第二条线路。此外,即使各
条路的metric不同也可以使用多路径路由。 例如,如果一条路径比另一条好三倍, 它将
以三倍使用率运行。只有具有一定范围内的最佳路径metric值的路由才用作多路径路由。
1、稳定性
IGRP提供许多特性以增强其稳定性,包括hold-down、split horizon和poison-reverse。
Hold-down用于阻止定期更新信息不适当地发布一条可能失效的路由信息。当一个路由器失
效时, 相邻的路由器通过未收到定期的更新消息检测到该情况, 这些路由器就计算新的
路由并发送路由更新信息把路由改变通知给它们相邻的路由器。 这一举动激发一系列触发
的更新,这些触发的更新并不能立刻到达每一个网络设备,所以可能发生这样的情况: 一
个还未收到网络失效信息的设备给一个刚被通知网络失效的设备发送定期更新信息,说那
条已断掉的路由还是好的,这样, 后者就会含有(还可能发布)错误的路由信息。Hold-
down告诉路由器把可能影响路由的改变保持一段时间。 Hold-down时期通常只比整个网络
更新某一路由改变所需时间多一点。
Split horizon来源于下列承诺:把路由信息发回到其来源是无意义的。下图示意为split
-horizon规则。 路由器1(R1)首先发布到网络A的路由,路由器2(R2)没有必要在给R1
的更新信息中含有该路由,因为R1离网络A更近。 split-horizon规则要求R2在给R1的更新
信息中去掉该路由。 split-horizon规则可以帮助避免路由环。例如,假设R1到网络A的接
口失效了,R2继续通知R1说它可以到达网络A(通过R1), 如果R1不够聪明,就可能用R2
的路由取代已失效的直接连接,于是就产生了路由环。虽然Hold-down应该防止这类情况,
IGRP也实现了split-horizon,因为它可提供更好的算法稳定性。

Split-horizon应该防止相邻路由器间的路由环,而poison-reverse对于防止较大的路由环
是必要的。 路由metric的持续增长通常意味着存在路由环,poison-reverse更新就被发送
以删除该路由并置于hold-down状态。 在Cisco的IGRP实现中,如果路由metric以1.1或更
大的比例增长就发送poison-reverse更新信息。
2、计时器
IGRP维护一组计时器和含有时间间隔的变量。包括更新计时器、失效计时器、保持计时器
和清空计时器。 更新计时器规定路由更新消息应该以什么频度发送,IGRP中此值缺省为90
秒。失效计时器规定在没有特定路由的路由更新消息时, 在声明该路由失效前路由器应等
待多久,IGRP中此值缺省为更新周期的三倍。保持时间变量规定hold-down周期, IGRP中
此值缺省为更新周期加10秒。最后,清空计时器规定路由器清空路由表之前等待的时间,
IGRP的缺省值为路由更新周期的七倍
IGRP协议
  IGRP (Interior Gateway Routing Protocol)是一种动态距离向量路由协议,它由
Cisco公司八十年代中期设计。使用组合用户配置尺度,包括延迟、带宽、可靠性和负载。
缺省情况下,IGRP每90秒发送一次路由更新广播,在3个更新周期内(即270秒),没有从路
由中的第一个路由器接收到更新,则宣布路由不可访问。在7个更新周期即630秒后,Cisco
IOS 软件从路由表中清除路由。
1. 有关命令
任务
 命令
 
指定使用 RIP协议
 router igrp autonomous-system 1
 
指定与该路由器相连的网络
 network network
 
指定与该路由器相邻的节点地址
 neighbor ip-address
 
 

注:1、autonomous-system可以随意建立,并非实际意义上的autonomous-system,但运行
IGRP的路由器要想交换路由更新信息其autonomous-system需相同。
2.举例

Router1:
router igrp 200
network 192.200.10.0
network 192.20.10.0
!
1. 启动IGRP路由协议,在全局设置模式下;
router igrp 自治域号
同一自治域内的路由器才能交换路由信息。
2. 本路由器参加动态路由的子网;
net work 子网号
IGRP只是将由net work指定的子网在各端口中进行传送以交换路由信息,如果不指定子网
,则路由器不会将该子网广播给其它路由器。
3. 指定某路由器所知的IGRP路由信息广播给那些与其相邻接的路由器;
neighbor 邻接路由器的相邻端口IP地址。
IGRP是一个广播型协议,为了使IGRP路由信息能在非广播型网络中传输,必须使用该设置
,以允许路由器间在非广播型网络中交换路由信息,广播型网络如以太网无须设置此项。
以上为IGRP的基本设置,通过该设置,路由器已能完全通过IGRP进行路由信息交换其他设
置。
4. 不允许某个端口发送IGRP路由信息
passive-interface 端口号
一般地,在以太网上只有一台路由器时,IGRP广播没有任何意义,且浪费带宽,完全可以
将其过滤掉。
5. 负载平衡设置
IGRP可以在两个进行IP通信的设备间同时启用四条线路,且任何一条路径断掉都不会影响
其它路径的传输。
当两条路径或多条路径的metric相同或在一定的范围内,就可以启动平衡功能。
1. 设置是否使用负载平衡功能。
traffic-share balanced 或min
balanced 表示启用负载平衡min表示不启用负载平衡, 只走最优路径。
2 . 设置路径间的metric相差多大时,可以在路径间启用负载平衡。
variance metric 差值
缺省值为1,表示只有两条路径metric相同时才能在两条路径上启用负载平衡。
实例:
 
2511-1的设置
Current configuration:
version 11.3
no service password-encryption
!
hostname 2511-1
!
enable password cisco
!
!
interface Ethernet0
ip address 192.4.1.1 255.255.255.0
!
interface Serial0
ip address 192.3.1.1 255.255.255.0
encapsulation frame-relay IETF
no ip mroute-cache
bandwidth 2000
frame-relay map ip 192.3.1.2 100 broadcast
frame-relay lmi-type cisco
!
interface Serial1
ip address 192.1.1.1 255.255.255.0
encapsulation ppp
bandwidth 64
!
router igrp 10
passive-interface Ethernet0
network 192.1.1.0 255.255.255.0
network 192.3.1.0 255.255.255.0
network 192.4.1.0 255.255.255.0
neighbor 192.1.1.2
neighbor 192.3.1.2
!
ip classless
!
line con 0
line 1 8
line aux 0
line vty 0 4
!
end
2505的设置
Current configuration:
!
version 11.2
no service udp-small-servers
no service tcp-small-servers
!
hostname 2505
!
enable secret 5 $1$GbYT$OR05giiLZxl4hEAO0F8kV1
!
!
hub ether 0 1
link-test
auto-polarity
!
hub ether 0 2
link-test
auto-polarity
!
hub ether 0 3
link-test
auto-polarity
!
hub ether 0 4
link-test
auto-polarity
!
hub ether 0 5
link-test
auto-polarity
!
hub ether 0 6
link-test
auto-polarity
!
hub ether 0 7
link-test
auto-polarity
!
hub ether 0 8
link-test
auto-polarity
!
interface Ethernet0
ip address 192.1.4.1 255.255.255.0
!
interface Serial0
ip address 192.1.2.1 255.255.255.0
bandwidth 2000
clockrate 2000000
!
interface Serial1
ip address 192.1.1.2 255.255.255.0
enpsuration ppp
bandwidth 64
clockrate 64000
!
router igrp 10
passive-interface Ethernet0
network 192.1.1.0 255.255.255.0
network 192.1.2.0 255.255.255.0
network 192.1.4.0 255.255.255.0
neighbor 192.1.1.1
neighbor 192.1.2.2
!
no ip classless
!
line con 0
line aux 0
line vty 0 4
login
!
end
internal-2的设置
Current configuration :
!
!
version 11.2
no service udp-small-servers
no service tcp-small-servers
!
hostname internal-2
!
enable secret 5 $1$KX00$rTI/2TvDokWxT4xC6wvmi/
!
!
interface Ethernet0
no ip address
shutdown
!
interface Serial0
ip address 192.1.2.2 255.255.255.0
!
interface Serial1
no ip address
shutdown
!
router igrp 10
network 192.1.2.0 255.255.255.0
neighbor 192.1.2.1
!
no ip classless
!
line con 0
line 1 16
line aux 0
line vty 0 4
login
!
end
2514的设置
Current configuration :
!
!
version 11.2
no service udp-small-servers
no service tcp-small-servers
!
hostname 2514
!
enable secret 5 $1$uoHU$Vks/lY CRi33z4TXs4qekI0
!
frame-relay switching
!
interface Ethernet0
ip address 192.5.1.1 255.255.255.0
!
interface Ethernet1
no ip address
shutdown
!
interface Serial0
ip address 192.3.1.2 255.255.255.0
encapsulation frame-relay IETF
bandwidth 2000
clockrate 2000000
frame-relay map ip 192.3.1.1 100 broadcast
frame-relay intf-type dce
!
interface Serial1
ip address 192.2.1.1 255.255.255.0
no ip mroute-cache
encapsulation X25 dce
bandwidth 64
x25 address 1234
x25 htc 16
x25 nvc 4
x25 map ip 192.2.1.2 5678 broadcast
clockrate 64000
!
router igrp 10
passive-interfce Ethernet0
network 192.3.1.0 255.255.255.0
network 192.2.1.0 255.255.255.0
network 192.5.1.0 255.255.255.0
neighbor 192.2.1.2
neighbor 192.3.1.1
!
no ip classless
!
line con 0
line aux 0
line vty 0 4
login
!
end
2511-2的设置
Building configuration…
Current configuration:
version 11.3
no service password-encryption
!
hostname 2511-2
!
enable secret 5 $1$7o5F$MSyFWzVf6JBgnjLJghHSB.
!
interface Ethernet0
ip address 192.2.4.1 255.255.255.0
!
interface Serial0
ip address 192.2.1.2 255.255.255.0
encapsulation x25
no ip mroute-cache
x25 address 5678
x25 htc 16
x25 nvc 4
x25 map ip 192.2.1.1 1234 broadcast
!
interface Serial1
ip address 192.2.2.1 255.255.255.0
no ip mroute-cache
bandwidth 2000
clockrate 2000000
!
router igrp 10
network 192.2.2.0 255.255.255.0
network 192.2.4.0 255.255.255.0
network 192.2.1.0 255.255.255.0
neighbor 192.2.1.1
neighbor 192.2.2.2
!
ip classless
!
line con 0
line 1 8
line aux 0
line vty 0 4
login
!
end
internal -1的设置
Building configuration…
Current configuration:
version 11.2
no service udp-small-servers
no service tcp-small-servers
!
hostname internal-1
!
enable secret 5 $1$cF2M$z2T8Ohij5q/yn2RsiVaGE/
!
!
interface Ethernet0
no ip address
shutdown
!
interface Serial0
ip address 192.2.2.2 255.255.255.0
!
interface Serial1
no ip address
shutdown
!
router igrp 10
network 192.2.2.0 255.255.255.0
neighbor 192.2.2.1
!
no ip classless
!
line con 0
line 1 16
line aux 0
line vty 0 4
login
!
end