且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

CCNP路由实验---1、EIGRP的基本配置

更新时间:2022-10-02 13:53:06

CCNP路由实验---1EIGRP的基本配置

一、实验目的

1、掌握EIGRP的基本配置。

2、掌握EIGRP的通配符掩配置方法。

3、掌握EIGRP的自动汇总特性,以及如何关闭自动汇总。

4、掌握EIGRP的手工汇总。

二、实验拓扑

CCNP路由实验---1、EIGRP的基本配置

实验步骤:

1、配置各路由器的名称、相连接口IP地址;

R1(config)#int s1/1

R1(config-if)#ip add 172.16.1.1 255.255.255.252

R1(config-if)#no shut

R1(config)#int loopback 0

R1(config-if)#ip add 10.1.0.1 255.255.255.0

R1(config-if)#int loopback 1              

R1(config-if)#ip add 10.1.1.1 255.255.255.0

R1(config-if)#int loopback 2              

R1(config-if)#ip add 10.1.2.1 255.255.255.0

R1(config-if)#int loopback 3              

R1(config-if)#ip add 10.1.3.1 255.255.255.0

 其它R2R3类似进行配置。配置完后用ping命令确认各路由器的直连口的互通性。

2、  配置EIGRP协议,设置自治系统号为80

R1

R1(config)#router eigrp 80

R1(config-router)#network 172.16.0.0

R2

R2(config)#router eigrp 80

R2(config-router)#network 172.16.0.0

R2(config-router)#network 111.111.0.0

R3

R3(config)#router eigrp 80

R3(config-router)#network 172.16.0.0

   备注:通常在路由器上配置EIGRP宣告通路网络时使用两种方法,方法1network +主类网络号,这样可以将路由器上相关地址的接口直接加入到EIGRP路由进程中去;方法2:使用通配符掩码进行配置,例如network X.X.X.X 0.0.0.X。这里先用第一种方法实验,后面将使用第二种方法实验。

3、  至此,EIGRP已经配置好,下面进行验证了。

4、  首先在各路由器上查看是否已经建立EIGRP的邻居关系:

R2#sh ip eigrp 80 nei

IP-EIGRP neighbors for process 80

H   Address                 Interface       Hold Uptime   SRTT   RTO  Q  Seq

                                            (sec)         (ms)       Cnt Num

1   172.16.1.6              Se1/2             12 00:00:40    1  3000  0  2

0   172.16.1.1              Se1/0             12 00:03:41    1  4500  0  2

备注:列H指出邻居学习的顺序,Address指出邻居地址;Interface指出邻居所在本地接口;Hold Uptime表示等待没有从邻居那里接收到任何包的最大时间.当接受到新的包以后,holdtimer复位;RTO(RetransmitTimeOut):单位是毫秒,表示路由器在重新传输包之前等待ACK的时间;QCnt:等待发送的排队排列的包.如果这个值持续高于0的话,说明发生了拥塞问题。

5、  查看路由表。

R2#sh 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

 

     172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks

C       172.16.1.4/30 is directly connected, Serial1/2

D       172.16.0.0/16 is a summary, 00:28:58, Null0

C       172.16.1.0/30 is directly connected, Serial1/0

D    10.0.0.0/8 [90/2297856] via 172.16.1.1, 00:06:20, Serial1/0

C    111.111.0.0/16 is directly connected, Loopback0

D    192.168.0.0/24 [90/2297856] via 172.16.1.6, 00:05:43, Serial1/2

备注:EUGRP会自动的对子网进行汇总生成一条指向null0的路由,是为了避免环回路由。前面标D表示是EIGRP路由,[90/2297856]中的90EIGRP的内部管理距离,2297856表示EIGRP计算的度量值(FD)。

如果只想看EIGRP的路由进程,可以使用命令:show  ip route eigrp

R2#sh ip route eigrp

     172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks

D       172.16.0.0/16 is a summary, 00:34:39, Null0

D    10.0.0.0/8 [90/2297856] via 172.16.1.1, 00:12:01, Serial1/0

D    192.168.0.0/24 [90/2297856] via 172.16.1.6, 00:11:24, Serial1/2

6、  从上面R2的路由表中观察到有一条指向s1/0口的10.0.0.0/8的汇总路由,这是EIGRP路由协议自动汇总的特性体现。可以使用no auto-summary命令关闭它。

首先是在R1进行关闭。

R1(config)#router eigrp 80

R1(config-router)#no au

R1(config-router)#no auto-summary

然后再次观察R2的路由表

R2#sh 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

 

     172.16.0.0/30 is subnetted, 2 subnets

C       172.16.1.4 is directly connected, Serial1/2

C       172.16.1.0 is directly connected, Serial1/0

     10.0.0.0/24 is subnetted, 4 subnets

D       10.1.3.0 [90/2297856] via 172.16.1.1, 00:00:01, Serial1/0

D       10.1.2.0 [90/2297856] via 172.16.1.1, 00:00:01, Serial1/0

D       10.1.1.0 [90/2297856] via 172.16.1.1, 00:00:01, Serial1/0

D       10.1.4.0 [90/2297856] via 172.16.1.1, 00:00:01, Serial1/0

C    111.111.0.0/16 is directly connected, Loopback0

D    192.168.0.0/24 [90/2297856] via 172.16.1.6, 00:11:27, Serial1/2

备注:当使用no auto-summary命令关闭EIGRP的自动汇总之后,再次查看R2的路由表可以到有关汇总为10.0.0.0/8前的详细路由了。

7、  EIGRP还可以人工设置地址汇总。人工设置地址汇总,也可以有效的减少路由表的大小。比如在R2上的路由中关于R3192.168.*.*的网络显示为四条具体路由:

D    192.168.0.0/24 [90/2297856] via 172.16.1.6, 00:05:09, Serial1/1

D    192.168.1.0/24 [90/2297856] via 172.16.1.6, 00:05:09, Serial1/1

D    192.168.2.0/24 [90/2297856] via 172.16.1.6, 00:05:09, Serial1/1

D    192.168.3.0/24 [90/2297856] via 172.16.1.6, 00:05:09, Serial1/1

可以在R3上进行如下配置,减少路由通告条目。

R3(config)#int s1/1

R3(config-if)#ip summary eigrp 80 192.168.0.0 255.255.252.0

随后再查看R2的路由表

R2#sh ip rout

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

 

     172.16.0.0/30 is subnetted, 2 subnets

C       172.16.1.4 is directly connected, Serial1/2

C       172.16.1.0 is directly connected, Serial1/0

     10.0.0.0/24 is subnetted, 4 subnets

D       10.1.3.0 [90/2297856] via 172.16.1.1, 00:19:33, Serial1/0

D       10.1.2.0 [90/2297856] via 172.16.1.1, 00:19:33, Serial1/0

D       10.1.1.0 [90/2297856] via 172.16.1.1, 00:19:33, Serial1/0

D       10.1.4.0 [90/2297856] via 172.16.1.1, 00:19:33, Serial1/0

C    111.111.0.0/16 is directly connected, Loopback0

D    192.168.0.0/22 [90/2297856] via 172.16.1.6, 00:00:26, Serial1/2

备注:可以看到最后一条路由汇总成了

D    192.168.0.0/22 [90/2297856] via 172.16.1.6, 00:00:26, Serial1/2

8、  前面说过有两种方法可以配置EIGRP宣告通路网络,所以现在说下第二种方法———使用通配符进行配置EIGRP。例如R2上使用通配符掩码进行配置EIGRP

首先删除之前所使用网络号配置的EIGRP,使用命令

R2(config)#no router eigrp 80

然后重新在R2上配置EIGRP

R2(config)#router eigrp 80

R2(config-router)#networ

R2(config-router)#network 172.16.1.0 0.0.0.3 

R2(config-router)#network 111.111.0.0

    备注:使用通配符掩码配置EIGRP,优点是可以很好的控制在哪些接口加入到EIGRP的进程中。否则的话可能需要使用passive-interface命令进行设置。此处仅将s1/2接口加入到eigrp中,所以R2s1/2接口,和R3的路由不会被转发给R1.

   再查看一下R2 的邻居表

R2#show ip eigrp neighbors

IP-EIGRP neighbors for process 80

H   Address                 Interface       Hold Uptime   SRTT   RTO  Q  Seq

                                                 (sec)         (ms)       Cnt Num

0   172.16.1.1              Se1/0             12 00:04:57 1510  5000  0  5

     此时可以看到R2只与R1建立了邻居关系。

     再查看R1路由表

R1#show ip route eigrp

     172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks

 D       172.16.0.0/16 is a summary, 00:02:55, Null0

     10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks

 D       10.0.0.0/8 is a summary, 00:02:55, Null0

 D    111.111.0.0/16 [90/2297856] via 172.16.1.2, 00:00:06, Serial1/1

     可以看到R1 只学习到了R2的路由项,而学到不到R3的路由。也就是说采用通配符掩码,进行选择性的配置,使得R1仅学习到131.131.0.0/16的路由条目。无法学习到R3的直接路由。



本文转自 独钩寒江雪 51CTO博客,原文链接:http://blog.51cto.com/bennie/397221,如需转载请自行联系原作者