CCNP-EIGRP
路由汇总:
实验拓扑:
实验目标:
EIGRP
的自动汇总和
EIGRP
的手工汇总
路由的基本配置(略)
IP
地址配置:
(R1.R2
启用
2
个环回接口,
R4
启用
4
个环回接口
)
r1(config)#in s1/0
r1(config-if)#ip add 219.146.0.1 255.255.255.0
r1(config-if)#no sh
r1(config-if)#in loo 0
r1(config-if)#ip add 219.146.4.1 255.255.255.0
r1(config-if)#in loo 1
r1(config-if)#ip add 219.146.5.1 255.255.255.0
r1(config-if)#exi
r2(config)#in s1/0
r2(config-if)#ip add 219.146.2.1 255.255.255.0
r2(config-if)#no sh
r2(config-if)#in loo 0
r2(config-if)#ip add 219.146.6.1 255.255.255.0
r2(config-if)#in loo 1
r2(config-if)#ip add 219.146.7.1 255.255.255.0
r2(config-if)#exi
r3(config)#in s1/0
r3(config-if)#ip add 219.146.0.2 255.255.255.0
r3(config-if)#no sh
r3(config-if)#in s1/1
r3(config-if)#ip add 219.146.2.2 255.255.255.0
r3(config-if)#no sh
r3(config-if)#in s1/2
r3(config-if)#ip add 219.146.3.1 255.255.255.0
r3(config-if)#no sh
r3(config-if)#exi
r4(config)#in s1/0
r4(config-if)#ip add 219.146.3.2 255.255.255.0
r4(config-if)#no sh
r4(config-if)#in loo 0
r4(config-if)#ip add 219.146.8.1 255.255.255.0
r4(config-if)#in loo 1
r4(config-if)#ip add 219.146.9.1 255.255.255.0
r4(config-if)#in loo 2
r4(config-if)#ip add 219.146.10.1 255.255.255.0
r4(config-if)#in loo 3
r4(config-if)#ip add 219.146.11.1 255.255.255.0
r4(config-if)#exi
EIGRP
的自动汇总:
配置
EIGRP:(
不关闭自动汇总
)
r1(config)#no router e 10
r1(config)#router e 10
r1(config-router)#net 219.146.0.0 0.0.0.255
r1(config-router)#net 219.146.4.0 0.0.1.255 //
汇总宣告(并不是路由汇总)
r1(config-router)#exi
r2(config)#router e 10
r2(config-router)#net 219.146.2.0 0.0.0.255
r2(config-router)#net 219.146.6.0 0.0.1.255
r2(config-router)#exi
r3(config)#router e 10
r3(config-router)#net 219.146.0.0 0.0.0.255
r3(config-router)#net 219.146.2.0 0.0.1.255
r3(config-router)#exi
r4(config)#router e 10
r4(config-router)#net 219.146.3.0 0.0.0.255
r4(config-router)#net 219.146.8.0 0.0.0.255 //
注意这里的宣告。不能全部汇总。
r4(config-router)#net 219.146.9.0 0.0.0.255
r4(config-router)#net 219.146.10.0 0.0.1.255
r4(config-router)#exi
现在来看一下路由表:
r1(config)#do sh ip rou
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
D 219.146.6.0/24 [90/2809856] via 219.146.0.2, 00:00:27, Serial1/0
D 219.146.7.0/24 [90/2809856] via 219.146.0.2, 00:00:27, Serial1/0
C 219.146.4.0/24 is directly connected, Loopback0
C 219.146.5.0/24 is directly connected, Loopback1
D 219.146.2.0/24 [90/2681856] via 219.146.0.2, 00:00:29, Serial1/0
D 219.146.3.0/24 [90/2681856] via 219.146.0.2, 00:00:29, Serial1/0
C 219.146.0.0/24 is directly connected, Serial1/0
D 219.146.10.0/24 [90/2809856] via 219.146.0.2, 00:00:26, Serial1/0
D 219.146.11.0/24 [90/2809856] via 219.146.0.2, 00:00:26, Serial1/0
D 219.146.8.0/24 [90/2809856] via 219.146.0.2, 00:00:26, Serial1/0
D 219.146.9.0/24 [90/2809856] via 219.146.0.2, 00:00:26, Serial1/0
r2(config)#do sh ip rou
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.6.0/24 is directly connected, Loopback0
C 219.146.7.0/24 is directly connected, Loopback1
D 219.146.4.0/24 [90/2809856] via 219.146.2.2, 00:01:45, Serial1/0
D 219.146.5.0/24 [90/2809856] via 219.146.2.2, 00:01:45, Serial1/0
C 219.146.2.0/24 is directly connected, Serial1/0
D 219.146.3.0/24 [90/2681856] via 219.146.2.2, 00:01:45, Serial1/0
D 219.146.0.0/24 [90/2681856] via 219.146.2.2, 00:01:45, Serial1/0
D 219.146.10.0/24 [90/2809856] via 219.146.2.2, 00:01:44, Serial1/0
D 219.146.11.0/24 [90/2809856] via 219.146.2.2, 00:01:44, Serial1/0
D 219.146.8.0/24 [90/2809856] via 219.146.2.2, 00:01:44, Serial1/0
D 219.146.9.0/24 [90/2809856] via 219.146.2.2, 00:01:44, Serial1/0
r3(config-if)#do sh ip rou
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
D 219.146.6.0/24 [90/2297856] via 219.146.2.1, 00:02:04, Serial1/1
D 219.146.7.0/24 [90/2297856] via 219.146.2.1, 00:02:04, Serial1/1
D 219.146.4.0/24 [90/2297856] via 219.146.0.1, 00:02:06, Serial1/0
D 219.146.5.0/24 [90/2297856] via 219.146.0.1, 00:02:06, Serial1/0
C 219.146.2.0/24 is directly connected, Serial1/1
C 219.146.3.0/24 is directly connected, Serial1/2
C 219.146.0.0/24 is directly connected, Serial1/0
D 219.146.10.0/24 [90/2297856] via 219.146.3.2, 00:02:04, Serial1/2
D 219.146.11.0/24 [90/2297856] via 219.146.3.2, 00:02:04, Serial1/2
D 219.146.8.0/24 [90/2297856] via 219.146.3.2, 00:02:04, Serial1/2
D 219.146.9.0/24 [90/2297856] via 219.146.3.2, 00:02:04, Serial1/2
r4(config)#do sh ip rou
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
D 219.146.6.0/24 [90/2809856] via 219.146.3.1, 00:02:28, Serial1/0
D 219.146.7.0/24 [90/2809856] via 219.146.3.1, 00:02:28, Serial1/0
D 219.146.4.0/24 [90/2809856] via 219.146.3.1, 00:02:28, Serial1/0
D 219.146.5.0/24 [90/2809856] via 219.146.3.1, 00:02:28, Serial1/0
D 219.146.2.0/24 [90/2681856] via 219.146.3.1, 00:02:28, Serial1/0
C 219.146.3.0/24 is directly connected, Serial1/0
D 219.146.0.0/24 [90/2681856] via 219.146.3.1, 00:02:28, Serial1/0
C 219.146.10.0/24 is directly connected, Loopback2
C 219.146.11.0/24 is directly connected, Loopback3
C 219.146.8.0/24 is directly connected, Loopback0
C 219.146.9.0/24 is directly connected, Loopback1
看到虽然开启了自动汇总,但实际上并没有汇总,因为这里的有类网络相同
(C
类
)
,子网掩码相同
(/24)
,所以
EIGRP
不进行自动汇总。修改一下:
r1(config)#in loo 0
r1(config-if)#no ip add
r1(config-if)#ip add 219.146.4.1 255.255.255.128
r1(config-if)#in loo 1
r1(config-if)#no ip add
r1(config-if)#ip add 219.146.4.129 255.255.255.128
r1(config-if)#exi
r1(config)#router e 10
r1(config-router)#no net 219.146.4.0 0.0.1.255
r1(config-router)#net 219.146.4.0 0.0.0.255
r1(config-router)#exi
再查看一下:
r3(config)#do sh ip rou
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
D 219.146.6.0/24 [90/2297856] via 219.146.2.1, 00:18:06, Serial1/1
D 219.146.7.0/24 [90/2297856] via 219.146.2.1, 00:18:06, Serial1/1
D 219.146.4.0/24 [90/2297856] via 219.146.0.1, 00:00:05, Serial1/0
C 219.146.2.0/24 is directly connected, Serial1/1
C 219.146.3.0/24 is directly connected, Serial1/2
C 219.146.0.0/24 is directly connected, Serial1/0
D 219.146.10.0/24 [90/2297856] via 219.146.3.2, 00:18:06, Serial1/2
D 219.146.11.0/24 [90/2297856] via 219.146.3.2, 00:18:06, Serial1/2
D 219.146.8.0/24 [90/2297856] via 219.146.3.2, 00:18:06, Serial1/2
D 219.146.9.0/24 [90/2297856] via 219.146.3.2, 00:18:06, Serial1/2
已经进行了汇总。
下面在
R1
上关闭自动汇总,会发生什么情况?
r1(config)#router e 10
r1(config-router)#no au
r1(config-router)#exi
再看一下
R3
的路由表:
r3(config)#do sh ip rou
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
D 219.146.6.0/24 [90/2297856] via 219.146.2.1, 00:21:30, Serial1/1
D 219.146.7.0/24 [90/2297856] via 219.146.2.1, 00:21:30, Serial1/1
219.146.4.0/25 is subnetted, 2 subnets
D 219.146.4.0 [90/2297856] via 219.146.0.1, 00:01:16, Serial1/0
D 219.146.4.128 [90/2297856] via 219.146.0.1, 00:01:16, Serial1/0
C 219.146.2.0/24 is directly connected, Serial1/1
C 219.146.3.0/24 is directly connected, Serial1/2
C 219.146.0.0/24 is directly connected, Serial1/0
D 219.146.10.0/24 [90/2297856] via 219.146.3.2, 00:21:29, Serial1/2
D 219.146.11.0/24 [90/2297856] via 219.146.3.2, 00:21:29, Serial1/2
D 219.146.8.0/24 [90/2297856] via 219.146.3.2, 00:21:29, Serial1/2
D 219.146.9.0/24 [90/2297856] via 219.146.3.2, 00:21:29, Serial1/2
看到现在并没有进行汇总,当然在
R2
、
R4
上也没有进行汇总。
因为
EIGRP
只对参与的网络
(
直连网络
)
进行自动汇总
。
总结:
EIGRP
自动汇兑的条件:
(1)
有类网络不同
(2)
子网掩码不同
(3)
参与的网络
EIGRP
的手工汇总:
以
R1
为例:
r1(config)#in s1/0 //
在接口下做路由汇总
r1(config-if)#ip summary-address eigrp 10 219.146.4.0 255.255.255.0
r1(config-if)#exi
r3(config)#do sh ip rou
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
D 219.146.6.0/24 [90/2297856] via 219.146.2.1, 00:40:19, Serial1/1
D 219.146.7.0/24 [90/2297856] via 219.146.2.1, 00:40:19, Serial1/1
D 219.146.4.0/24 [90/2297856] via 219.146.0.1, 00:00:34, Serial1/0
C 219.146.2.0/24 is directly connected, Serial1/1
C 219.146.3.0/24 is directly connected, Serial1/2
C 219.146.0.0/24 is directly connected, Serial1/0
D 219.146.10.0/24 [90/2297856] via 219.146.3.2, 00:40:18, Serial1/2
D 219.146.11.0/24 [90/2297856] via 219.146.3.2, 00:40:18, Serial1/2
D 219.146.8.0/24 [90/2297856] via 219.146.3.2, 00:40:18, Serial1/2
D 219.146.9.0/24 [90/2297856] via 219.146.3.2, 00:40:18, Serial1/2
已经汇总了。再查看一下
R1.
这样看:
r1#sh ip rou 219.146.4.0 255.255.255.0
Routing entry for 219.146.4.0/24
Known via "eigrp 10", distance 5, metric 128256, type internal
Redistributing via eigrp 10
Routing Descriptor Blocks:
* directly connected, via Null0
Route metric is 128256, traffic share count is 1
Total delay is 5000 microseconds, minimum bandwidth is 10000000 Kbit
Reliability 255/255, minimum MTU 1514 bytes
Loading 1/255, Hops 0
看到这条汇总的路由管理距离是
5.
这个管理距离只在本地有效。在别的路由器上看不是
5.
r1#sh run int s1/0
Building configuration...
Current configuration : 146 bytes
!
interface Serial1/0
ip address 219.146.0.1 255.255.255.0
ip summary-address eigrp 10 219.146.4.0 255.255.255.0 5
serial restart-delay 0
end
这样也能看到管理距离是
5.
手工汇总总结:
EIGRP
手工汇总可以在任意接口下。(出接口)
EIGRP
手工汇总后的度量值是汇总前所有路由度量值最小的。
EIGRP
手工汇总后在本地会产生一条指向
Null0
的路由。(避免环路)
EIGRP
手工汇总后只有当所有明细路由都消失了才会删除汇总路由。
EIGRP
不支持
CIDR
(超网
)
。