CCNP-22 路由重发布2
实验拓扑:
实验要求:
R1
与
R2
之间采用
RIP
路由协议,
R3
与
R2
之间采用
EIGRP
路由协议,要使
R1
和
R3
能够相互学习到对方的路由。
试验目的:掌握
RIP
与
EIGRP
路由重发布的基本配置。
试验配置:
R1
:
R1(config)#int s1/0
R1(config-if)#ip add 199.99.1.1 255.255.255.0
R1(config-if)#no shu
R1(config-if)#exit
R1(config)#int loop0
R1(config-if)#ip add 172.16.0.1 255.255.255.0
R1(config-if)#exit
R1(config)#int loop1
R1(config-if)#ip add 172.16.1.1 255.255.255.0
R1(config-if)#exit
R1(config)#int loop2
R1(config-if)#ip add 172.16.2.1 255.255.255.0
R1(config-if)#exit
R1(config)#int loop3
R1(config-if)#ip add 172.16.3.1 255.255.255.0
R1(config-if)#exit
R1(config)#int loop4
R1(config-if)#ip add 172.16.4.1 255.255.255.0
R1(config-if)#exit
R1(config)#int loop5
R1(config-if)#ip add 172.16.5.1 255.255.255.0
R1(config-if)#exit
R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#network 172.16.0.0
R1(config-router)#network 172.16.1.0
R1(config-router)#network 172.16.2.0
R1(config-router)#network 172.16.3.0
R1(config-router)#network 172.16.4.0
R1(config-router)#network 172.16.5.0
R1(config-router)#network 199.99.1.0
R1(config-router)#no auto-summary
R1(config-router)#end
R2
:
R2(config)#int s1/0
R2(config-if)#ip add 199.99.1.2 255.255.255.0
R2(config-if)#clock rate 64000
R2(config-if)#no shu
R2(config-if)#exit
R2(config)#int s1/1
R2(config-if)#ip add 199.99.2.1 255.255.255.0
R2(config-if)#clock rate 64000
R2(config-if)#no shu
R2(config-if)#exit
R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#network 199.99.1.0
R2(config-router)#end
R2#config t
R2(config)#router eigrp 100
R2(config-router)#network 199.99.2.0
0.0.0
.255
R2(config-router)#end
R3
:
R3(config)#int s1/0
R3(config-if)#ip add 199.99.2.2 255.255.255.0
R3(config-if)#no shu
R3(config-if)#exit
R3(config)#int loop0
R3(config-if)#ip add 172.17.0.1 255.255.255.0
R3(config-if)#exit
R3(config)#int loop1
R3(config-if)#ip add 172.17.1.1 255.255.255.0
R3(config-if)#exit
R3(config)#int loop2
R3(config-if)#ip add 172.17.2.1 255.255.255.0
R3(config-if)#exit
R3(config)#int loop3
R3(config-if)#ip add 172.17.3.1 255.255.255.0
R3(config-if)#exit
R3(config)#int loop4
R3(config-if)#ip add 172.17.4.1 255.255.255.0
R3(config-if)#exit
R3(config)#int loop5
R3(config-if)#ip add 172.17.5.1 255.255.255.0
R3(config-if)#exit
R3(config)#router eigrp 100
R3(config-router)#network 172.17.0.0
0.0.0
.255
R3(config-router)#network 172.17.1.0
0.0.0
.255
R3(config-router)#network 172.17.2.0
0.0.0
.255
R3(config-router)#network 172.17.3.0
0.0.0
.255
R3(config-router)#network 172.17.4.0
0.0.0
.255
R3(config-router)#network 172.17.5.0
0.0.0
.255
R3(config-router)#network 199.99.2.0
0.0.0
.255
R3(config-router)#no auto-summary
R3(config-router)#end
基本的配置已经完成,下面分别查看三台路由器的路由表:
R1#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
172.16.0.0/24 is subnetted, 6 subnets
C 172.16.4.0 is directly connected, Loopback4
C 172.16.5.0 is directly connected, Loopback5
C 172.16.0.0 is directly connected, Loopback0
C 172.16.1.0 is directly connected, Loopback1
C 172.16.2.0 is directly connected, Loopback2
C 172.16.3.0 is directly connected, Loopback3
C 199.99.1.0/24 is directly connected, Serial1/0
R2#show ip route
*Mar 1 00:02:40.927: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 100: Neighbor 199.99.2.2 (Serial1/1) is resync: peer graceful-restart
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.17.0.0/24 is subnetted, 6 subnets
D 172.17.5.0 [90/2297856] via 199.99.2.2, 00:00:01, Serial1/1
D 172.17.4.0 [90/2297856] via 199.99.2.2, 00:00:01, Serial1/1
D 172.17.1.0 [90/2297856] via 199.99.2.2, 00:00:01, Serial1/1
D 172.17.0.0 [90/2297856] via 199.99.2.2, 00:00:01, Serial1/1
D 172.17.3.0 [90/2297856] via 199.99.2.2, 00:00:01, Serial1/1
D 172.17.2.0 [90/2297856] via 199.99.2.2, 00:00:01, Serial1/1
172.16.0.0/24 is subnetted, 6 subnets
R 172.16.4.0 [120/1] via 199.99.1.1, 00:00:13, Serial1/0
R 172.16.5.0 [120/1] via 199.99.1.1, 00:00:13, Serial1/0
R 172.16.0.0 [120/1] via 199.99.1.1, 00:00:13, Serial1/0
R 172.16.1.0 [120/1] via 199.99.1.1, 00:00:13, Serial1/0
R 172.16.2.0 [120/1] via 199.99.1.1, 00:00:13, Serial1/0
R 172.16.3.0 [120/1] via 199.99.1.1, 00:00:13, Serial1/0
C 199.99.2.0/24 is directly connected, Serial1/1
C 199.99.1.0/24 is directly connected, Serial1/0
R3#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
172.17.0.0/24 is subnetted, 6 subnets
C 172.17.5.0 is directly connected, Loopback5
C 172.17.4.0 is directly connected, Loopback4
C 172.17.1.0 is directly connected, Loopback1
C 172.17.0.0 is directly connected, Loopback0
C 172.17.3.0 is directly connected, Loopback3
C 172.17.2.0 is directly connected, Loopback2
C 199.99.2.0/24 is directly connected, Serial1/0
R1
与
R3
的路由表都显示的是自己直接连接的路由,
R2
的路由表里有从
EIGRP
和
RIP
学到的路由,下面开始配置路由重发布,首先把
EIGRP
重发布到
RIP
中:
R2(config)#router rip
R2(config-router)#redistribute eigrp 100 metric 3
R2(config-router)#exit
好了,下面我们在
R1
上查看路由表:
R1#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
R 172.17.0.0/16 [120/3] via 199.99.1.2, 00:00:04, Serial1/0
172.16.0.0/24 is subnetted, 6 subnets
C 172.16.4.0 is directly connected, Loopback4
C 172.16.5.0 is directly connected, Loopback5
C 172.16.0.0 is directly connected, Loopback0
C 172.16.1.0 is directly connected, Loopback1
C 172.16.2.0 is directly connected, Loopback2
C 172.16.3.0 is directly connected, Loopback3
R 199.99.2.0/24 [120/3] via 199.99.1.2, 00:00:04, Serial1/0
C 199.99.1.0/24 is directly connected, Serial1/0
多了两条
RIP
路由,这两条路由是从
EIGRP
重发布过来的,并且自动汇总了,然后配置把
RIP
重发布到
EIGRP
中:
R2(config)#router eigrp 100
R2(config-router)#redistribute rip metric ?
<1-4294967295> Bandwidth metric in Kbits per second
R2(config-router)#redistribute rip metric 64 ?
<0-4294967295> EIGRP delay metric, in 10 microsecond units
R2(config-router)#redistribute rip metric 64 1 ?
<0-255> EIGRP reliability metric where 255 is 100% reliable
R2(config-router)#redistribute rip metric 64 1 255 ?
<1-255> EIGRP Effective bandwidth metric (Loading) where 255 is 100% loaded
R2(config-router)#redistribute rip metric 64 1 255 1 ?
<1-65535> EIGRP MTU of the path
R2(config-router)#redistribute rip metric 64 1 255 1 1500 ?
R2(config-router)#end
在把
RIP
重发布到
EIGRP
是要注意的问题就是
metric
值依次是:带宽
—
延迟
—
可靠性
—
负载
—MTU
,然后再到
R3
上查看路由表:
R3#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
172.17.0.0/24 is subnetted, 6 subnets
C 172.17.5.0 is directly connected, Loopback5
C 172.17.4.0 is directly connected, Loopback4
C 172.17.1.0 is directly connected, Loopback1
C 172.17.0.0 is directly connected, Loopback0
C 172.17.3.0 is directly connected, Loopback3
C 172.17.2.0 is directly connected, Loopback2
172.16.0.0/24 is subnetted, 6 subnets
D EX 172.16.4.0 [170/40512256] via 199.99.2.1, 00:00:03, Serial1/0
D EX 172.16.5.0 [170/40512256] via 199.99.2.1, 00:00:03, Serial1/0
D EX 172.16.0.0 [170/40512256] via 199.99.2.1, 00:00:03, Serial1/0
D EX 172.16.1.0 [170/40512256] via 199.99.2.1, 00:00:03, Serial1/0
D EX 172.16.2.0 [170/40512256] via 199.99.2.1, 00:00:03, Serial1/0
D EX 172.16.3.0 [170/40512256] via 199.99.2.1, 00:00:04, Serial1/0
C 199.99.2.0/24 is directly connected, Serial1/0
D EX 199.99.1.0/24 [170/40512256] via 199.99.2.1, 00:00:04, Serial1/0
OK
,多了七条
EIGRP
系统外部路由,管理距离为
170
,这些路由并没有汇总,我们来把它们汇总,
RIP
的路由汇总我们在上一个试验中已经介绍过一种方法,就是在接口模式下配置汇总的方法,这回我们用另外一种方法:
R1(config)#router rip
R1(config-router)#auto-summary
R1(config-router)#end
这样配置完成后,也可以达到汇总的效果,但是这样汇总和在接口模式下配置会总是有区别的,我记得以前好像讲过,这里我们在重提一下:配置自动汇总只能汇总成主网络掩码,而接口模式下可以不用配置成主网络掩码的形式。
好了,让我们在重新查看一下
R3
的路由表:
R3#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
172.17.0.0/24 is subnetted, 6 subnets
C 172.17.5.0 is directly connected, Loopback5
C 172.17.4.0 is directly connected, Loopback4
C 172.17.1.0 is directly connected, Loopback1
C 172.17.0.0 is directly connected, Loopback0
C 172.17.3.0 is directly connected, Loopback3
C 172.17.2.0 is directly connected, Loopback2
D EX 172.16.0.0/16 [170/40512256] via 199.99.2.1, 00:00:40, Serial1/0
C 199.99.2.0/24 is directly connected, Serial1/0
D EX 199.99.1.0/24 [170/40512256] via 199.99.2.1, 00:00:40, Serial1/0
现在变成了两条了。
我们再来看一下
R2
的路由表的情况:
R2#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
172.17.0.0/24 is subnetted, 6 subnets
D 172.17.5.0 [90/2297856] via 199.99.2.2, 00:00:45, Serial1/1
D 172.17.4.0 [90/2297856] via 199.99.2.2, 00:00:45, Serial1/1
D 172.17.1.0 [90/2297856] via 199.99.2.2, 00:00:45, Serial1/1
D 172.17.0.0 [90/2297856] via 199.99.2.2, 00:00:45, Serial1/1
D 172.17.3.0 [90/2297856] via 199.99.2.2, 00:00:45, Serial1/1
D 172.17.2.0 [90/2297856] via 199.99.2.2, 00:00:45, Serial1/1
R 172.16.0.0/16 [120/1] via 199.99.1.1, 00:00:15, Serial1/0
C 199.99.2.0/24 is directly connected, Serial1/1
C 199.99.1.0/24 is directly connected, Serial1/0
RIP
的路由被汇总了,但是
EIGRP
的路由并没有被汇总,我们这里来手工汇总
EIGRP
的路由:
R3(config)#int s1/0
R3(config-if)#ip summary-address eigrp 100 172.17.0.0 255.255.0.0
R3(config-if)#exit
和
RIP
一样,
EIGRP
的汇总也可以在接口模式下配置,还有一种方法是启用默认汇总,我们在配置
EIGRP
的时候已经取消了默认汇总了。完成后我们再到
R2
上查看路由表:
R2#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
D 172.17.0.0/16 [90/2297856] via 199.99.2.2, 00:00:01, Serial1/1
R 172.16.0.0/16 [120/1] via 199.99.1.1, 00:00:01, Serial1/0
C 199.99.2.0/24 is directly connected, Serial1/1
C 199.99.1.0/24 is directly connected, Serial1/0
好了,现在
R2
的路由表小多了,从
RIP
和
EIGRP
学到的都是汇总后的路由!
实验总结:掌握
RIP
和
EIGRP
路由重发布的基本配置。
本文转自loveme2351CTO博客,原文链接:
http://blog.51cto.com/loveme23/49295
,如需转载请自行联系原作者