配置EIGRP:

一、拓扑如上

二、配置三个路由器的ip地址,如图规划

r1#show ip int brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES unset  administratively down down   
Serial1/0                  192.168.1.1     YES manual up                    up     
Serial1/1                  unassigned      YES unset  administratively down down   
Serial1/2                  unassigned      YES unset  administratively down down   
Serial1/3                  unassigned      YES unset  administratively down down   
Loopback0                  1.1.1.1         YES manual up                    up

 

r2#show ip int brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES unset  administratively down down   
Serial1/0                  192.168.1.2     YES manual up                    up     
Serial1/1                  192.168.2.1     YES manual up                    up     
Serial1/2                  unassigned      YES unset  administratively down down   
Serial1/3                  unassigned      YES unset  administratively down down   

 

 

r3#show ip int br 
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES unset  administratively down down   
Serial1/0                  unassigned      YES unset  administratively down down   
Serial1/1                  192.168.2.2     YES manual up                    up     
Serial1/2                  unassigned      YES unset  administratively down down   
Serial1/3                  unassigned      YES unset  administratively down down   
Loopback0                  3.3.3.3         YES manual up                    up     

三、配置EIGRP路由

r1(config)#router eigrp 1
r1(config-router)#no auto
r1(config-router)#no auto-summary
r1(config-router)#network 1.1.1.0 0.0.0.255
r1(config-router)#network 192.168.1.0
r1(config-router)#end

r2(config)#router eigrp 1
r2(config-router)#no auto
r2(config-router)#no auto-summary
r2(config-router)#network 192.168.1.0
r2(config-router)#network 192.168.2.0
r2(config-router)#networ

r3#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
r3(config)#router eigrp 1
r3(config-router)#no au
r3(config-router)#no auto-summary
r3(config-router)#network 192.168.2.0
r3(config-router)#network
00:10:55: %DUAL-5-NBRCHANGE: IP-EIGRP 1: Neighbor 192.168.2.1 (Serial1/1) is up: new adjacency
r3(config-router)#network 3.3.3.0 0.0.0.255
r3(config-router)#end

EIGRP 协议在通告网段时,如果是主类网络(即标准 A、B、C 类的网络,或者说没有划
分子网的网络),只需输入此网络地址;如果是子网的话,则最好在网络号后面写子网掩码
或者反掩码,这样可以避免将所有的子网都加入 EIGRP 进程中。
反掩码是用广播地址(255.255.255.255)减去子网掩码所得到。如掩码地址是
255.255.248.0,则反掩码地址是 0.0.7.255。在高级的 IOS中也支持网络掩码的写法。
运行 EIGRP的整个网络 AS 号码必须一致,其范围为 1-65535之间。

四、网络调试

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
     3.0.0.0/24 is subnetted, 1 subnets
D       3.3.3.0 [90/2809856] via 192.168.1.2, 00:06:14, Serial1/0
C    192.168.1.0/24 is directly connected, Serial1/0
D    192.168.2.0/24 [90/2681856] via 192.168.1.2, 00:07:15, Serial1/0

以上输出表明:路由器R1通过EIGRP学到了3条EIGRP路由条目,管理距离为90,注意EIGRP协议代码用字幕"D"表示,如果通过重分布进入EIGRP网络的路由条目,默认管理距离是170,路由代码用“D EX”表示,这也说明EIGRP路由协议能够区分内部路由和外部路由。

 

r1#show ip protocols
Routing Protocol is "eigrp 1"    //AS1
  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
  EIGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0  //计算度量值用的K值
  EIGRP maximum hopcount 100
  EIGRP maximum metric variance 1
  Redistributing: eigrp 1
  Automatic network summarization is not in effect   //自动汇总以关闭,默认是开启的
  Maximum path: 4   //默认允许四条链路负载
  Routing for Networks:
    1.1.1.0/24
    192.168.1.0
  Routing Information Sources:
    Gateway         Distance      Last Update
    192.168.1.2           90      00:11:52
  Distance: internal 90 external 170

查看EIGRP路由协议中R1的邻居表

r1#show ip eigrp neighbors
IP-EIGRP neighbors for process 1
H   Address                 Interface   Hold Uptime   SRTT   RTO  Q  Seq Type
                                        (sec)         (ms)       Cnt Num
0   192.168.1.2             Se1/0         13 00:16:57   48   288  0  5  

每个字段的含义:

① H: 表示与邻居建立会话的顺序;
② Address: 邻居路由器的接口地址;
③ Interface: 本地到邻居路由器的接口;
④ Hold: 认为邻居关系不存在所能等待的最大时间;
⑤ Uptime: 从邻居关系建立到目前的时间;
⑥ SRTT: 是向邻居路由器发送一个数据包以及本路由器收到确认包的时间;
⑦ RTO: 路由器在重新传输包之前等待 ACK 的时间;
⑧ Q Cnt: 等待发送的队列;
⑨ Seq Num: 从邻居收到的发送数据包的序列号。

【技术要点】运行EIGRP路由协议的路由器不能建立邻居关系的可能原因:

a,EIGRP进程的AS号码不同

b,计算度量值的K值不同

查看拓扑表

r1#show ip eigrp topology
IP-EIGRP Topology Table for AS(1)/ID(1.1.1.1)

Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status

P 1.1.1.0/24, 1 successors, FD is 128256
         via Connected, Loopback0
P 3.3.3.0/24, 1 successors, FD is 2809856
         via 192.168.1.2 (2809856/2297856), Serial1/0
P 192.168.1.0/24, 1 successors, FD is 2169856
         via Connected, Serial1/0
P 192.168.2.0/24, 1 successors, FD is 2681856
         via 192.168.1.2 (2681856/2169856), Serial1/0

以上输出可以清楚地看到每条路由条目的 FD 和RD 的值。 而拓扑结构数据库中状态代码
最常见的是“P” , “A”和“s”,含义如下:
① P: 代表passive,表示网络处于收敛的稳定状态; 
② A: 代表active,当前网络不可用,正处于发送查询状态;
③ s:在3分钟内,如果被查询的路由没有收到回应,查询的路由就被置为“stuck  in
active”状态。
 
【术语】
可行距离(FD) :到达一个目的网络的最小度量值;
通告距离(RD) :邻居路由器所通告的它自己到达目的网络的最小的度量值;
可行性条件(FC) :是 EIGRP 路由器更新路由表和拓扑表的依据。可行性条件可以有效
地阻止路由环路,实现路由的快速收敛。可行性条件的公式为:AD<FD。 
  r2#show ip eigrp interfaces
IP-EIGRP interfaces for process 1

                    Xmit Queue   Mean   Pacing Time   Multicast    Pending
Interface    Peers  Un/Reliable  SRTT   Un/Reliable   Flow Timer   Routes
Se1/0          1        0/0        72       0/15          50           0
Se1/1          1        0/0        68       0/15         283           0

以上输出各字段的含义如下: 
① Interface:运行 EIGRP 协议的接口;
② Peers:该接口的邻居的个数;
③ Xmit Queue Un/Reliable:在不可靠/可靠队列中存留的数据包的数量;
④ Mean SRTT:平均的往返时间,单位是秒;
⑤ Pacing Time Un/Reliable:用来确定不可靠/可靠队列中数据包被送出接口的时间
间隔;
⑥ Multicast Flow Timer:组播数据包被发送前最长的等待时间;
⑦ Pending Routes:在传送队列中等待被发送的数据包携带的路由条目。

r2#show ip eigrp traffic
IP-EIGRP Traffic Statistics for process 1
  Hellos sent/received: 3437/3421
  Updates sent/received: 15/18
  Queries sent/received: 3/0
  Replies sent/received: 0/3
  Acks sent/received: 16/9
  Input queue high water mark 3, 0 drops
  SIA-Queries sent/received: 0/0
  SIA-Replies sent/received: 0/0

以上输出显示了 EIGRP发送和接收到的数据包的统计情况。

【术语】
在 EIGRP 中,有五种类型的数据包:  
① Hello:以组播的方式定期发送,用于建立和维持邻居关系;
  ② 更新:当路由器收到某个邻居路由器的第一个 Hello 包时,以单播传送方式回送一个包含它所知道的路由信息的更新包。当路由信息发生变化时,以组播的方式发送只包含变
化信息的更新包; 
   ③ 查询:当一条链路失效,路由器重新进行路由计算,但在拓扑表中没有可行的后继
路由时,路由器就以组播的方式向它的邻居发送一个查询包,以询问它们是否有一条到目的
地的后继路由;  
  ④ 答复:以单播的方式回传给查询方,对查询数据包进行应答; 
⑤ 确认:以单播的方式传送,用来确认更新、查询、答复数据包。

r2#debug eigrp neighbors
EIGRP Neighbors debugging is on
r2#
02:25:05: EIGRP: Holdtime expired
02:25:05: %DUAL-5-NBRCHANGE: IP-EIGRP 1: Neighbor 192.168.1.1 (Serial1/0) is down: holding time expired
r2#
02:25:05: EIGRP: Neighbor 192.168.1.1 went down on Serial1/0



NEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to down
r2#

这时在ROUTER1上把s1/0端口,关闭之后,出线的情况

让后在激活s1/0端口
5:50: EIGRP: New peer 192.168.1.1
r2#
02:25:50: %DUAL-5-NBRCHANGE: IP-EIGRP 1: Neighbor 192.168.1.1 (Serial1/0) is up: new adjacency
02:25:51: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to up
r2#

该命令可以动态查看 EIGRP 邻居关系的情况。在路由器 R1 先将 s1/0shutdown
掉,然后再 no shutdown,可以看到 EIGRP 邻居建立的过程。

r2#debug eigrp packets
EIGRP Packets debugging is on
    (UPDATE, REQUEST, QUERY, REPLY, HELLO, IPXSAP, PROBE, ACK, STUB, SIAQUERY, SIAREPLY)
r2#
02:28:35: EIGRP: Sending HELLO on Serial1/1
02:28:35:   AS 1, Flags 0x0, Seq 0/0 idbQ 0/0 iidbQ un/rely 0/0
r2#
02:28:38: EIGRP: Received HELLO on Serial1/1 nbr 192.168.2.2
02:28:38:   AS 1, Flags 0x0, Seq 0/0 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/0
02:28:38: EIGRP: Sending HELLO on Serial1/0
02:28:38:   AS 1, Flags 0x0, Seq 0/0 idbQ 0/0 iidbQ un/rely 0/0
02:28:38: EIGRP: Received HELLO on Serial1/0 nbr 192.168.1.1
02:28:38:   AS 1, Flags 0x0, Seq 0/0 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/0
r2#un al

该命令可以显示 EIGRP发送和接收的数据包。