天天看點

CCNA之旅-eigrp協定2

CCNA之旅-eigrp協定2

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     

r1#

r2#show ip int brief

Serial1/0                  192.168.1.2     YES manual up                    up     

Serial1/1                  192.168.2.1     YES manual up                    up     

r2#

r3#show ip int brief

Serial1/0                  unassigned      YES unset  administratively down down   

Serial1/1                  192.168.2.2     YES manual up                    up     

Loopback0                  3.3.0.3         YES manual up                    up     

Loopback1                  3.3.1.3         YES manual up                    up     

Loopback2                  3.3.2.3         YES manual up                    up     

Loopback3                  3.3.3.3         YES manual up                    up     

r3#

三、配置EIGRP路由選擇協定 AS:1

r1(config)#router eigrp 1

r1(config-router)#network 1.0.0.0

r1(config-router)#network 192.168.1.0

r1(config-router)#end

r1# //在這裡我們沒有關閉R1EIGRP路由選擇協定的自動彙總功能,在配置R3的時候我們關閉路由自動彙總功能,配置完成後我們檢視路由表....

00:05:53: %SYS-5-CONFIG_I: Configured from console by console

r3#conf t

r3(config)#router eigrp 1

r3(config-router)#no auto

r3(config-router)#network 192.168.2.0

r3(config-router)#network 3.0.0.0

r3(config-router)#end

R2配置我們這裡也先不關閉路由自動彙總功能

r2#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

r2(config)#router eigrp 1

r2(config-router)#network 192.168.1.0

r2(config-router)#network 192.168..0

00:06:06: %DUAL-5-NBRCHANGE: IP-EIGRP 1: Neighbor 192.168.1.1 (Serial1/0) is up: new adjacency

r2(config-router)#network 192.168.2.0

r2(config-router)#end

#

配置完成後我們在R1上檢視路由表

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/8 is variably subnetted, 2 subnets, 2 masks

D       1.0.0.0/8 is a summary, 00:03:35, Null0

C       1.1.1.0/24 is directly connected, Loopback0

     3.0.0.0/24 is subnetted, 4 subnets

D       3.3.0.0 [90/2809856] via 192.168.1.2, 00:00:13, Serial1/0

D       3.3.1.0 [90/2809856] via 192.168.1.2, 00:00:13, Serial1/0

D       3.3.2.0 [90/2809856] via 192.168.1.2, 00:00:13, Serial1/0

D       3.3.3.0 [90/2809856] via 192.168.1.2, 00:00:13, 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:03:19, Serial1/0

r1#ping 3.3.3.3

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 96/127/168 ms

我們發現,R1明明開啟了路由自動彙總功能,但是收到的R3通知的路由資訊,裡面仍然有子網的資訊,這時為什麼呢?

預設的時候 EIGRP 的自動彙總是開啟的,自動彙總隻對本地産生的 EIGRP路由彙總,可以通

過“no auto-summary”指令關閉自動彙總,然後進行手工彙總。

也就是說,R1上的路由自動彙總,隻對自己通告的網段起作用,對别的不起作用

現在,我們把三個路由上的EIGRP路由自動彙總功能全部關閉,然後在R3的S1/0接口上手動彙總路由

r3(config)#int s1/1

r3(config-if)#ip summary-address eigrp 1 3.3.0.0 255.255.252.0

r3(config-if)#end

我們檢視自己的路由表:

r3#show ip  route

D    1.0.0.0/8 [90/2809856] via 192.168.2.1, 00:01:33, Serial1/1

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

D       3.3.0.0/22 is a summary, 00:01:39, Null0

C       3.3.0.0/24 is directly connected, Loopback0

C       3.3.1.0/24 is directly connected, Loopback1

C       3.3.2.0/24 is directly connected, Loopback2

C       3.3.3.0/24 is directly connected, Loopback3

D    192.168.1.0/24 [90/2681856] via 192.168.2.1, 00:01:33, Serial1/1

C    192.168.2.0/24 is directly connected, Serial1/1

我們發現多了一條EIGRP路由條目,主要是為了防止路由環路。

在路由器1和路由器2上會收到彙總後的路由資訊。

r2#show ip route

D    1.0.0.0/8 [90/2297856] via 192.168.1.1, 00:18:44, Serial1/0

     3.0.0.0/22 is subnetted, 1 subnets

D       3.3.0.0 [90/2297856] via 192.168.2.2, 00:03:44, Serial1/1

D       1.0.0.0/8 is a summary, 00:15:38, Null0

D       3.3.0.0 [90/2809856] via 192.168.1.2, 00:00:22, Serial1/0

D    192.168.2.0/24 [90/2681856] via 192.168.1.2, 00:15:22, Serial1/0

思考:如果我們把路由器3上的回環接口,改成192.168.96.3/24 192.168.97.3/24 192.168.98.3/24 192.168.99.3/24 那麼我們還能彙總到192.168.96.0/252嗎??????

Loopback0                  192.168.96.3    YES manual up                    up     

Loopback1                  192.168.97.3    YES manual up                    up     

Loopback2                  192.168.98.3    YES manual up                    up     

Loopback3                  192.168.99.3    YES manual up                    up     

r3(config-router)#network 192.168.96.0

r3(config-router)#network 192.168.97.0

r3(config-router)#network 192.168.98.0

r3(config-router)#network 192.168.99.0

r3(config-if)#ip summary-address eigrp 1 192.168.96.0 255.255.252.0

我們看到很順利的配置完成,沒有像RIP2那樣提示不讓這樣設定,

看路由1和2的路由表

r1#show ip route   

D       1.0.0.0/8 is a summary, 00:38:46, Null0

D    192.168.2.0/24 [90/2681856] via 192.168.1.2, 00:38:30, Serial1/0

D    192.168.96.0/22 [90/2809856] via 192.168.1.2, 00:04:25, Serial1/0

繼續閱讀