eigrp配置:
 
实验拓扑图:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
实验目的:
   (一):EIGRP的配置
   (二):EIGRP的手工汇总
 
(一):EIGRP的配置
r2基本信息配置:
Router>en
Router#conf t
Router(config)#enable secret abc
Router(config)#line console 0
Router(config-line)#password abc
Router(config-line)#login
Router(config-line)#logging synchronous
Router(config-line)#exec-timeout 0 0
Router(config-line)#exi
Router(config)#no ip domain lookup
Router(config)#no cdp run
Router(config)#hostname r2
 
r2(config)#in s1/0
r2(config-if)#ip add 219.146.2.1 255.255.255.0
r2(config-if)#no shut
r2(config-if)#in loo 0       //虚拟环回接口
r2(config-if)#ip add 172.16.0.1 255.255.255.0
r2(config-if)#in loo 1
r2(config-if)#ip add 172.16.1.1 255.255.255.0
r2(config-if)#in loo 2
r2(config-if)#ip add 172.16.2.1 255.255.255.0
r2(config-if)#in loo 3
r2(config-if)#ip add 172.16.3.1 255.255.255.0
r2(config-if)#exi
 
r2(config)#router eigrp 10    //自治系统号必须一样
r2(config-router)#network 219.146.2.0 0.0.0.255   //添加直连网络(反掩码可以不加)
r2(config-router)#network 172.16.0.0 0.0.0.255 
r2(config-router)#network 172.16.1.0 0.0.0.255
r2(config-router)#network 172.16.2.0 0.0.0.255
r2(config-router)#network 172.16.3.0 0.0.0.255
r2(config-router)#exi
 
 

r3基本信息配置:
Router>en
Router#conf t
Router(config)#enable secret abc
Router(config)#line console 0
Router(config-line)#password abc
Router(config-line)#login
Router(config-line)#logging synchronous
Router(config-line)#exec-timeout 0 0
Router(config-line)#exi
Router(config)#no ip domain lookup
Router(config)#no cdp run
Router(config)#hostname r3
 
r3(config)#in s1/1
r3(config-if)#ip add 219.146.2.2 255.255.255.0
r3(config-if)#no shut
r3(config-if)#in s1/2
r3(config-if)#ip add 219.146.3.1 255.255.255.0
r3(config-if)#no shut
r3(config-if)#exi
 
r3(config)#router eigrp 10   //自治系统号要一样才能互相交换路由表
r3(config-router)#network 219.146.2.0 0.0.0.255
r3(config-router)#network 219.146.3.0 0.0.0.255
r3(config-router)#exi
 
 
 

r4基本信息配置:
Router>en
Router#conf t
Router(config)#enable secret abc
Router(config)#line console 0
Router(config-line)#password abc
Router(config-line)#login
Router(config-line)#logging synchronous
Router(config-line)#exec-timeout 0 0
Router(config-line)#exi
Router(config)#no ip domain lookup
Router(config)#no cdp run
Router(config)#hostname r4
 
r4(config)#in s1/0
r4(config-if)#ip add 219.146.3.2 255.255.255.0
r4(config-if)#no shut
r4(config-if)#in loo 0
r4(config-if)#ip add 172.16.4.1 255.255.255.0
r4(config-if)#in loo 1
r4(config-if)#ip add 172.16.5.1 255.255.255.0
r4(config-if)#exi
 
r4(config)#router eigrp 10
r4(config-router)# network 219.146.3.0   //不要反掩码也可以
r4(config-router)#network 172.16.4.0
r4(config-router)#network 172.16.5.0
r4(config-router)#exi
 
现在来看一下r3的路由表:
r3(config)#do show ip route
Codes: C - connected, S - static, 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
       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
C    219.146.2.0/24 is directly connected, Serial1/1
C    219.146.3.0/24 is directly connected, Serial1/2
D    172.16.0.0/16 [90/2297856] via 219.146.3.2, 00:01:01, Serial1/2
                   [90/2297856] via 219.146.2.1, 00:01:01, Serial1/1

发现路由表已经出错。原因在eigrp会自动汇总。
 
r3(config)#do p 172.16.0.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.0.1, timeout is 2 seconds:
U.U.U
Success rate is 0 percent (0/5)
 
r3(config)#no ip cef    //关闭快速转发

r3(config)#do p 172.16.0.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.0.1, timeout is 2 seconds:
U!.!U
Success rate is 40 percent (2/5), round-trip min/avg/max = 60/76/92 ms

在r2上关闭自动汇总:
r2(config)#router eigrp 10
r2(config-router)# no auto-summary
r2(config-router)#exi
 
同样,在r4上也关闭自动汇总:
r4(config)#router eigrp 10
r4(config-router)# no auto-summary
r4(config-router)#exi
 
再查看一下r3的路由表:
r3(config)#do show ip route
Codes: C - connected, S - static, 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
       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
C    219.146.2.0/24 is directly connected, Serial1/1
C    219.146.3.0/24 is directly connected, Serial1/2
     172.16.0.0/24 is subnetted, 6 subnets
D       172.16.4.0 [90/2297856] via 219.146.3.2, 00:00:19, Serial1/2
D       172.16.5.0 [90/2297856] via 219.146.3.2, 00:00:19, Serial1/2
D       172.16.0.0 [90/2297856] via 219.146.2.1, 00:00:51, Serial1/1
D       172.16.1.0 [90/2297856] via 219.146.2.1, 00:00:51, Serial1/1
D       172.16.2.0 [90/2297856] via 219.146.2.1, 00:00:51, Serial1/1
D       172.16.3.0 [90/2297856] via 219.146.2.1, 00:00:51, Serial1/1
已经正常了。

r2(config)#do show ip pro   //查看当前运行的路由协议
Routing Protocol is "eigrp 10"
  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
  EIGRP maximum hopcount 100
  EIGRP maximum metric variance 1
  Redistributing: eigrp 10
  EIGRP NSF-aware route hold timer is 240s
  Automatic network summarization is not in effect
  Maximum path: 4
  Routing for Networks:
    172.16.0.0/24
    172.16.1.0/24
    172.16.2.0/24
    172.16.3.0/24
    219.146.2.0
  Routing Information Sources:
    Gateway         Distance      Last Update
    (this router)         90      00:15:31
    219.146.2.2           90      00:05:07
  Distance: internal 90 external 170
因为r2在添加直连网络时添加了反掩码,所以这里看到的是明细网络。

r4(config)#do show ip pro
Routing Protocol is "eigrp 10"
  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
  EIGRP maximum hopcount 100
  EIGRP maximum metric variance 1
  Redistributing: eigrp 10
  EIGRP NSF-aware route hold timer is 240s
  Automatic network summarization is not in effect
  Maximum path: 4
  Routing for Networks:
    172.16.0.0
    219.146.3.0
  Routing Information Sources:
    Gateway         Distance      Last Update
    (this router)         90      00:09:14
    219.146.3.1           90      00:01:04
  Distance: internal 90 external 170
因为在r4添加直连网络时没有添加反掩码。所以这里显示的是向有类边界汇总后的网络。这就是添加反掩码的区别。

(二):EIGRP的手工汇总
为了优化网络性能,所以我们对网络进行汇总。
 
r2(config)#in s1/0     //在接口下进行汇总
r2(config-if)#ip summary-address eigrp 10 172.16.0.0 255.255.252.0
r2(config-if)#exi
 
r4(config)#in s1/0
r4(config-if)#ip summary-address eigrp 10 172.16.4.0 255.255.254.0
r4(config-if)#exi

再查看r3的路由表:
r3(config)#do show ip route
Codes: C - connected, S - static, 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
       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
C    219.146.2.0/24 is directly connected, Serial1/1
C    219.146.3.0/24 is directly connected, Serial1/2
     172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
D       172.16.4.0/23 [90/2297856] via 219.146.3.2, 00:00:26, Serial1/2
D       172.16.0.0/22 [90/2297856] via 219.146.2.1, 00:02:14, Serial1/1
 
已经是汇总后的路由表了,网络性能得到了优化。路由表了缩小了很多。

常用调试命令:
Show ip interface brie 查看接口基本参数
Show int e0 查看E0查相关参数
Sho int s0  查看S0查相关参数
Sho int s1  查看S1查相关参数
Show run  查看当前运行配置
Show cdp neighbor 看CDP邻居
Show ip route 查看路由表的内容
Show ip protocol 查看当前运行的协议
Show ip eigrp neighbor 查看EIGRP邻居
Show ip eigrp top 查看EIGRP的拓扑信息
Debug eigrp packet查看EIGRP的DEBUG信息