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
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   
r2#

r3#show ip int brief
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.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
r2#
#

配置完成后我们在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#

我们发现,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#

我们查看自己的路由表:

r3#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

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
r3#

我们发现多了一条EIGRP路由条目,主要是为了防止路由环路。

在路由器1和路由器2上会收到汇总后的路由信息。

r2#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

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
C    192.168.1.0/24 is directly connected, Serial1/0
C    192.168.2.0/24 is directly connected, Serial1/1

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:15:38, Null0
C       1.1.1.0/24 is directly connected, Loopback0
     3.0.0.0/22 is subnetted, 1 subnets
D       3.3.0.0 [90/2809856] via 192.168.1.2, 00:00:22, 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: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吗??????

r3#show ip int brief
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                  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#

 

r3(config)#router eigrp 1
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-router)#end

r3#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
r3(config)#int s1/1

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

 

我们看到很顺利的配置完成,没有像RIP2那样提示不让这样设置,

看路由1和2的路由表

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:38:46, Null0
C       1.1.1.0/24 is directly connected, Loopback0
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:38:30, Serial1/0
D    192.168.96.0/22 [90/2809856] via 192.168.1.2, 00:04:25, Serial1/0
r1#

 

r2#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

D    1.0.0.0/8 [90/2297856] via 192.168.1.1, 00:39:20, Serial1/0
C    192.168.1.0/24 is directly connected, Serial1/0
C    192.168.2.0/24 is directly connected, Serial1/1
D    192.168.96.0/22 [90/2297856] via 192.168.2.2, 00:05:14, Serial1/1
r2#

从 R1和 R2 的路由表的输出可以看出 EIGRP 支持 CIDR 汇总,这一点和 RIPv2 是不相同
的。

 

你可能感兴趣的:(休闲,网络技术,CCNA,路由交换,EIGRP)