OSPF路由重分发配置实例

Posted BE冢虎

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了OSPF路由重分发配置实例相关的知识,希望对你有一定的参考价值。

实验要求:

配置网络,实现全网互通。


实验规划:

网络拓扑:

OSPF路由重分发配置实例_redis


地址规划:

IOU1

e0/0:192.168.11.1/24

loopback 0:1.1.1.1

e0/1:192.168.10.1/24


e0/2:100.0.0.0/24


IOU2

e0/0:192.168.10.2/24

loopback 0:2.2.2.2

e0/1:192.168.25.1/24


IOU3

e0/0:192.168.11.2/24

loopback 0:3.3.3.3

e0/1:192.168.12.1/24


IOU4

e0/0:192.168.12.2/24

loopback 0:192.168.3.1/24

IOU5

e0/0:192.168.25.2/24

loopback 0:192.168.2.1/24

ISP

e0/0:100.0.0.1/24

loopback 0:172.16.1.1/24


实验配置:

(部分代码注释参见本人其他博客)

基本配置:

IOU1:
config terminal
interface e0/0
ip address 192.168.11.1 255.255.255.0
no shutdown
interface e0/1
ip address 192.168.10.1 255.255.255.0
no shutdown
interface e0/2
ip address 100.0.0.2 255.255.255.0
no shutdown
interface loopback 0
ip address 1.1.1.1 255.255.255.255
no shutdown
exit
router ospf 1
router-id 1.1.1.1
network 1.1.1.1 0.0.0.0 area 0
network 192.168.10.0 0.0.0.255 area 0
network 192.168.11.0 0.0.0.255 area 1
network 100.0.0.2 0.0.0.255 area 0
ip route 0.0.0.0 0.0.0.0 100.0.0.1
IOU2:
config terminal
interface e0/0
ip address 192.168.10.2 255.255.255.0
no shutdown
interface e0/1
ip address 192.168.25.1 255.255.255.0
no shutdown
interface loopback 0
ip address 2.2.2.2 255.255.255.255
no shutdown
exit
router ospf 1
router-id 2.2.2.2
network 2.2.2.2 0.0.0.0 area 0
network 192.168.10.0 0.0.0.255 area 0
exit
router rip
version 2
network 192.168.25.0
exit
IOU3:
config terminal
interface e0/0
ip address 192.168.11.2 255.255.255.0
no shutdown
interface e0/1
ip address 192.168.12.1 255.255.255.0
no shutdown
interface loopback 0
ip address 3.3.3.3 255.255.255.255
no shutdown
exit
ip route 192.168.3.0 255.255.255.0 192.168.12.2
router ospf 1
router-id 3.3.3.3
network 3.3.3.3 0.0.0.0 area 1
nerwork 192.168.11.0 0.0.0.255 area 1
exit
IOU4:
config terminal
interface e0/0
ip address 192.168.12.2 255.255.255.0
no shutdown
interface loopback 0
ip address 192.168.3.1 255.255.255.0
no shutdown
exit
ip route 0.0.0.0 0.0.0.0 192.168.12.1
IOU5:
config terminal
interface e0/0
ip address 192.168.25.2 255.255.255.0
no shutdown
interface loopback 0
ip address 192.168.2.1 255.255.255.0
no shutdown
exit
router rip
version 2
network 192.168.25.0
network 192.168.2.0
exit
ISP:
config terminal
interface e0/0
ip address 100.0.0.1 255.255.255.0
no shutdown
interface loopback 0
ip address 172.16.1.1 255.255.255.0
no shutdown
exit
ip route 0.0.0.0 0.0.0.0 100.0.0.2


配置路由重分发:

IOU1:
router ospf 1
default-information originate //重分发默认路由
exit
IOU2:
router ospf 1
redistribute rip subnets //重分发rip路由
exit
router rip
redistribute ospf 1 metric 3 //重分发ospf路由
exit
IOU3:
router ospf 1
redistribute static subnets //重分发静态路由
redistribute connected subnets //重分发直连路由
exit


验证网络互通性:

查看路由表(IOU2,IOU5):
exit
show ip route

OSPF路由重分发配置实例_redis_02

OSPF路由重分发配置实例_网络通信_03


ping命令验证(IOU5):
ping 192.168.3.1
ping 172.16.1.1

OSPF路由重分发配置实例_redis_04

网络通信正常,结果符合预期,配置结束。


(如有疏漏,还请读者指出)


以上是关于OSPF路由重分发配置实例的主要内容,如果未能解决你的问题,请参考以下文章

动态路由协议OSPF高级配置

多种动态路由混合架构实验——OSPF协议+RIP协议+静态路由

OSPF的高级应用之路由重分发与NSSA的配置

路由器OSPF协议的高级配置之“路由重分发”

OSPF+RIP+路由重分发+NAT实例

OSPF路由重分发