资源描述
RIP 与OSPF 的路由再发布 配置实例
实验要求:
在R1、R2上配置OSPF区域1,在R2、R3上配置OSPF区域0,在R3、R4上配置RIP(V1),要求为
OSPF 与RIP(V1)互相重新发布,以便让每一台路由器的路由表中必须存在到达其他任何一台路由器的全
部子网的路由项目。
IP地址表:
路由器 接口 IP地址
R1 Loop0 10.10.10.10/24
R1 Loop1 172.16.10.1/28
R1 Loop2 1.1.1.1/28
R1 S0 172.16.1.1/30
R2 S0 172.16.1.2/30
R2 S1 172.16.2.1/30
R3 S0 172.16.2.2/30
R3 S1 172.16.3.1/24
R4 S0 172.16.3.2/24
R4 Loop0 4.4.4.4/24
实验配置如下:
一、基本配置
配置R1:
Router>en
Router#conf t
Router(config)#host R1
R1(config)#int loop0
R1(config-if)#ip add 10.10.10.10 255.255.255.0
R1(config-if)#int loop1
R1(config-if)#ip add 172.16.10.1 255.255.255.240
R1(config-if)#int loop2
R1(config-if)#ip add 1.1.1.1 255.255.255.240
R1(config-if)#int S0
R1(config-if)#ip add 172.16.1.1 255.255.255.252
R1(config-if)#no shut
R1(config-if)#end
R1#sh run
配置R2:
Router>en
Router#conf t
Router(config)#host R2
R2(config)#int S0
R2(config-if)#ip add 172.16.1.2 255.255.255.252
R2(config-if)#no shut
R2(config-if)#clock rate 64000
R2(config-if)#int S1
R2(config-if)#ip add 172.16.2.1 255.255.255.252
R2(config-if)#no shut
R2(config-if)#clock rate 64000
R2(config-if)#end
R2#sh run
配置R3:
Router>en
Router#conf t
Router(config)#host R3
R3(config)#int S0
R3(config-if)#ip add 172.16.2.2 255.255.255.252
R3(config-if)#no shut
R3(config-if)#int S1
R3(config-if)#ip add 172.16.3.1 255.255.255.0
R3(config-if)#no shut
R3(config-if)#clock rate 64000
R3(config-if)#end
R3#sh run
配置R4:
Router>en
Router#conf t
Router(config)#host R4
R4(config)#int S0
R4(config-if)#ip add 172.16.3.2 255.255.255.0
R4(config-if)#no shut
R4(config-if)#int loop0
R4(config-if)#ip add 4.4.4.4 255.255.255.0
R4(config-if)#end
R4#sh run
二、配置OSPF与RIP(V1)
R1#conf t
R1(config)#router ospf 10
R1(config-router)#network 172.16.1.1 0.0.0.3 area 1
R1(config-router)#network 10.10.10.10 0.0.0.255 area 1 //发布两个直连的网段
R1(config-router)#end
R1#sh ip route
R2#conf t
R2(config)#router ospf 20
R2(config-router)#network 172.16.1.2 0.0.0.3 area 1 //ABR 连接两个区域
R2(config-router)#network 172.16.2.1 0.0.0.3 area 0
R1(config-router)#end
R1#sh ip route
R3#conf t
R3(config)#router ospf 30
R3(config-router)#network 172.16.2.2 0.0.0.3 area 0
R3(config-router)#router rip
R3(config-router)#network 172.16.3.1 //ASBR 连接两个AS
R3(config-route)#end
R1#sh ip route
R4#conf t
R4(config)#router rip
R4(config-router)#network 172.16.3.2 //发布RIP
R4(config-router)#network 4.4.4.4
R4(config-router)#end
R4#sh ip route
三、路由再发布:
R1#conf t
R1(config)#router ospf 10
R1(config-router)#redistribute connected subnets //在R1上发布未通告的直连段
R1(config-route)#summary-address 172.16.10.1 255.255.255.0 //汇总成/24给RIP
R1(config-router)#end
R1#sh ip route
R2#conf t
R2(config)#router ospf 20
R2(config-router)#area 1 range 172.16.1.0 255.255.255.0 //在ABR 上进行区域1汇总
R2(config-router)#end
R2#sh ip route
R3#conf t
R3(config)#router ospf 30
R3(config-router)#redistribute rip subnets
R3(config-router)#default-metric 64 //在ASBR 上重发布RIP
R3(config-router)#router rip
R3(config-router)#redistribute ospf 30 //在ASBR 上重发布OSPF
R3(config-router)#default-metric 2
R3(config-router)#exit
R3(config)#ip route 172.16.2.0 255.255.255.0 null 0 //在ASBR 上使用静态路由汇总到空接口,
通过空接口进行转发通信信息,便于RIP学习到
或者:
R3(config-router)#int S0
R3(config-if)#ip summary rip 172.16.2.0 255.255.255.0
R3(config)#end
R3#sh ip route
R1#sh ip route
R2#sh ip route
R4#sh ip route
R3#sh ip route
实验总结:
1.在R1上发布未通告的直连口,这样其他OSPF区域就可以学习到了。
2.由于RIP(V1)只支持有类路由,它只能学习到/8,/16/,/24的路由信息,所以需要在R1上对172.16.10.1/28
进行汇总,汇总成/24的,这样才能让RIP学习到。
3.为了让RIP(V1)学习到OSPF 上区域1的172.16.1.0/30 网段,需要在R2上对区域1的172.16.1.0 进行汇总。汇总成/24,这样RIP就可以学习到了。
4.为了让RIP(V1)能学习到OSPF的全部区域路由信息,需要在ASBR-R3上互相重新发布RIP和OSPF信息;为了让RIP(V1)学习到OSPF 的区域0 的172.16.2.0/30 的网段,需要在R3 上对区域0 的172.16.2.0通过空接口进行静态路由映射,映射成/24的,以便RIP能学习的。
经过上面的四步后,每台路由器特别是RIP(V1)区域的R4路由器就能学习到整个网络的全部路由信息。
PS:
1.在ABR 路由器上进行汇总:area <number> range ip-address netmask
例如:area 1 172.16.1.0 255.255.255.0
2.在ASBR 路由器上进行汇总:summary-address ip-address netmask
例如:summary-address 172.16.10.1 255.255.255.0
两者均在OSPF模式下配置!
展开阅读全文