万事须己运,他得非我贤。这篇文章主要讲述OSPF路由重分发配置实例相关的知识,希望能为你提供帮助。
实验要求:
配置网络,实现全网互通。
实验规划:
网络拓扑:
地址规划: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
ping命令验证(IOU5):ping 192.168.3.1
ping 172.16.1.1
网络通信正常,结果符合预期,配置结束。
【OSPF路由重分发配置实例】(如有疏漏,还请读者指出)
推荐阅读
- Lvs+DR模式
- 大数据笔记(HDFS-伪分布式模式)
- socket编程与线程的结合
- Pyhacker编写指南端口扫描器
- Python学习(自动化测试selenium的指定截图文件名(动态时间))
- 揭秘反射真的很耗时吗,射 10 万次用时多久
- 阿里云镜像迁移到Harbor详细的操作步骤
- 如何使用Python实现图像融合及加法运算()
- 大话数据结构溢彩加强版绪论篇