一:实验目的:
当某条路由丢失,并且没有可行后继者( feasible successor)时,EIGRP会发送Query.丢失的那条路由处于 active 状态.Query将被发向所有的邻居,除了原先的后继者(successor).如果邻居也没有关于那条路由的信息,query将被发送到邻居的邻居.当路由丢失时,在EIGRP重新计算新的successor之前,它必须获得所有邻居对query消息的reply.默认情况下,如果某个邻居在三分钟以内没有对query消息作出reply,那么这条路由将Stuck In Active (SIA),并且路由器将重启(rest)与这个邻居的邻居关系.
如果EIGRP 的网络多达数十台及数百台路由,那么如果出现某个网络出错,则有可以引起整个网络产生大量的查询回复包。所以为了避免这样的问题,可以使用ip summary 命令或stub 参数来进行配置EIGRP,限制EIGRP 的查询范围。
二:实验拓扑:


 
三:配置过程:
1:基本接口配置(按图):
2:配置EIGRP
 在R1和R2之间配置EIGRP
 在R2上配置到达3.3.3.0的静态路由和到达2.2.2.0的汇总路由。
R1(config)#router eigrp 90
R1(config-router)#network 1.1.1.0 0.0.0.255
R1(config-router)#network 12.0.0.0 0.0.0.255
R1(config-router)#no au

R2(config)#router eigrp 90
R2(config-router)#network 12.0.0.0 0.0.0.255         
R2(config-router)#network 2.2.2.0 0.0.0.255
R2(config-router)#no au
R2(config)#int f0/0
R2(config-if)#ip summary-address eigrp 90 2.2.0.0 255.255.248.0 5
R2(config)#ip route 3.3.3.0 255.255.255.0 23.0.0.3
R2(config)#router eigrp 90
R2(config-router)#redistribute static metric 10000 100 255 1 1500

//配置stub之前,R1上能够学到R2上通告过来的所有路由

R1#sho ip route      

  1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback0
     2.0.0.0/21 is subnetted, 1 subnets
D       2.2.0.0 [90/156160] via 12.0.0.2, 00:06:07, FastEthernet0/0
     3.0.0.0/24 is subnetted, 1 subnets
D EX    3.3.3.0 [170/284160] via 12.0.0.2, 00:03:03, FastEthernet0/0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.0.0.0 is directly connected, FastEthernet0/0

把R1的loopback接口down掉,模拟故障,没有配置stub之前的debug信息
R1(config)#int lo 0
R1(config-if)#sh
R2#debug eigrp packets
R2#debug eigrp packets
EIGRP Packets debugging is on
    (UPDATE, REQUEST, QUERY, REPLY, HELLO, IPXSAP, PROBE, ACK, STUB, SIAQUERY, SIAREPLY)
R2#
*Mar  1 00:25:24.739: EIGRP: Received QUERY on FastEthernet0/0 nbr 12.0.0.1
// R1会向它的邻居发起查询消息。
 即使向R1发起查询,R2也找不到相关的路由,反而会降低网络的收敛速度。
可以使用eigrp stub命令将路由器配置为末节路由器。非末节路由器发现EIGRP邻居为末节路由器后,便不会讲查询消息发送给它们。在路由进入主动状态后,这将极大的缩小查询范围,还可避免漫长,迂回甚至有害的路由。
*Mar  1 00:25:24.743:   AS 90, Flags 0x0, Seq 21/0 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/0
*Mar  1 00:25:24.743: EIGRP: Enqueueing ACK on FastEthernet0/0 nbr 12.0.0.1
*Mar  1 00:25:24.743:   Ack seq 21 iidbQ un/rely 0/0 peerQ un/rely 1/0
*Mar  1 00:25:24.747: EIGRP: Sending ACK on FastEthernet0/0 nbr 12.0.0.1
*Mar  1 00:25:24.751:   AS 90, Flags 0x0, Seq 0/21 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 1/0
*Mar  1 00:25:24.759: EIGRP: Enqueueing REPLY on FastEthernet0/0 nbr 12.0.0.1 iidbQ un/rely 0/1 peerQ un/rely 0/0 serno 19-19
*Mar  1 00:25:24.763: EIGRP: Requeued unicast on FastEthernet0/0
R2#
*Mar  1 00:25:24.767: EIGRP: Sending REPLY on FastEthernet0/0 nbr 12.0.0.1
*Mar  1 00:25:24.767:   AS 90, Flags 0x0, Seq 20/21 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/1 serno 19-19

3:配置EIGRP的末梢网络。
R2(config)#router eigrp 90
R2(config-router)#eigrp stub connected   // Stub后connected参数的测试。

R1#show ip eigrp neighbors detail
IP-EIGRP neighbors for process 90
H   Address                 Interface       Hold Uptime   SRTT   RTO  Q  Seq
                                            (sec)         (ms)       Cnt Num
0   12.0.0.2                Fa0/0             12 00:00:29  127   762  0  28
   Version 12.4/1.2, Retrans: 1, Retries: 0, Prefixes: 1
   Stub Peer Advertising ( CONNECTED ) Routes
   Suppressing queries
//在R1上可以看到12.0.0.2是一个末节邻居
R1#sho  ip route

     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback0
     2.0.0.0/24 is subnetted, 1 subnets
D       2.2.2.0 [90/156160] via 12.0.0.2, 00:01:58, FastEthernet0/0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.0.0.0 is directly connected, FastEthernet0/0
// R1上只学到到了R2上通告的直连路由。没有学习到汇总路由和重分发的静态路由。

R2(config)#router eigrp 90
R2(config-router)#no eigrp stub connected
R2(config-router)#eigrp stub static   // Eigrp static参数的测试。

R1#sho ip route
     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback0
     3.0.0.0/24 is subnetted, 1 subnets
D EX    3.3.3.0 [170/284160] via 12.0.0.2, 00:00:51, FastEthernet0/0  
     12.0.0.0/24 is subnetted, 1 subnets
C       12.0.0.0 is directly connected, FastEthernet0/0 
 // Static参数有重分发静态,没直连和汇总。
R2(config)#router eigrp 90
R2(config-router)#no eigrp stub static
R2(config-router)#eigrp stub receive-only   // receive-only参数测试

R1#sho ip route   
//发现R1上没有收到任何EIGRP的路由。
R2上却能收到R1上发送过来的路由更新。
说明receive-only表明只收路由更新,不发送EIGRP更新消息。
     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.0.0.0 is directly connected, FastEthernet0/0

R2#sho ip route
     1.0.0.0/24 is subnetted, 1 subnets
D       1.1.1.0 [90/156160] via 12.0.0.1, 00:02:20, FastEthernet0/0
     2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
D       2.2.0.0/21 is a summary, 00:46:53, Null0
C       2.2.2.0/24 is directly connected, Loopback0
     3.0.0.0/24 is subnetted, 1 subnets
S       3.3.3.0 [1/0] via 23.0.0.3
     23.0.0.0/24 is subnetted, 1 subnets
C       23.0.0.0 is directly connected, FastEthernet1/0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.0.0.0 is directly connected, FastEthernet0/0
R2(config)#router eigrp 90
R2(config-router)#no eigrp stub static
R2(config-router)#eigrp stub summary   // summary参数的测试

 

R1#sho ip route
     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback0
     2.0.0.0/21 is subnetted, 1 subnets   
//发现R1收到了R2发过来的汇总更新。
说明summary代表只发送汇总更新。
D       2.2.0.0 [90/156160] via 12.0.0.2, 00:00:57, FastEthernet0/0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.0.0.0 is directly connected, FastEthernet0/0

R2(config)#router eigrp 90
R2(config-router)#eigrp stub     //测试stub不携带参数

R1#sho ip eigrp neighbors detail
IP-EIGRP neighbors for process 90
H   Address                 Interface       Hold Uptime   SRTT   RTO  Q  Seq
                                            (sec)         (ms)       Cnt Num
0   12.0.0.2                Fa0/0             14 00:01:15  120   720  0  64
   Version 12.4/1.2, Retrans: 1, Retries: 0, Prefixes: 1
   Stub Peer Advertising ( CONNECTED SUMMARY ) Routes
   Suppressing queries

R1#show ip route
     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback0
     2.0.0.0/21 is subnetted, 1 subnets
D       2.2.0.0 [90/156160] via 12.0.0.2, 00:01:50, FastEthernet0/0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.0.0.0 is directly connected, FastEthernet0/0
//默认可以发送直连和汇总,但不发送静态。

4:总结:STUB选项总结:
receive-only: 防止STUB路由器发送路由更新

connected: 允许STUB路由器发送直连路由信息

static : 允许STUB路由器发送重发布静态的路由

summary :允许STUB路由器发送汇总路由信息

通过以上测试我们发现,要让R1学习到R2发布过来的重发布路由,以及汇总路由。必须要加上如下参数
R2
eigrp stub connected static summary
Note:默认STUB选项后面是connected 和summary