实验拓扑:

实验需求:引入外部路由,运行多个OSPF进程,并且相互之间进行重分发;所有路由器之间都能够相互ping通。
实验步骤:
配置路由器的每个端口的IP地址
R1:
enable
conf t
int f0/0
no shu
ip add 192.168.12.1 255.255.255.0
exit
int l 0
ip add 10.10.1.1 255.255.255.0
exit

R2:
enable
conf t
int f0/1
no shu
ip add 192.168.12.2 255.255.255.0
exit
int l 0
ip add 10.10.2.2 255.255.255.0
exit
int f0/0
no shu
ip add 192.168.23.2 255.255.255.0
exit

R3:
enable
conf t
int f 0/1
no shu
ip add 192.168.23.3 255.255.255.0
exit
int l 0
ip add 10.10.3.3 255.255.255.0
int f 0/0
no shu
ip add 192.168.34.3 255.255.255.0
exit

R4:
enable
conf t
int f0/1
no shu
ip add 192.168.34.4 255.255.255.0
exit
int l 0
ip add 10.10.4.4 255.255.255.0
exit
int f0/0
no shu
ip add 192.168.45.4 255.255.255.0
exit

R5:
enable
conf t
int f0/1
no shu
ip add 192.168.45.5 255.255.255.0
exit
int l 0
ip add 10.10.5.5 255.255.255.0
exit

在每个路由器开启OSPF并配置OSPF路由

R1:
router os 1
router-id 1.1.1.1
net 192.168.12.0 0.0.0.255 ar 0
net 10.10.1.0 0.0.0.255 ar 0
exit

R2:
router os 1
router-id 2.2.2.2
net 192.168.12.0 0.0.0.255 ar 0
net 10.10.2.0 0.0.0.255 ar 0
net 192.168.23.0 0.0.0.255 ar 0
exit

R3:
router os 1
router-id 3.3.3.3
net 192.168.23.0 0.0.0.255 ar 0
exit
router os 1
router-id 3.3.3.3
net 192.168.34.0 0.0.0.255 ar 12
net 10.10.3.0 0.0.0.255 ar 12
exit

R4:
router os 1
router-id 4.4.4.4
net 192.168.34.0 0.0.0.255 ar 12
exit
router os 45
router-id 6.6.6.6
net 192.168.45.0 0.0.0.255 ar 45
net 10.10.4.0 0.0.0.255 ar 45
exit

R5:
router os 45
router-id 5.5.5.5
net 192.168.45.0 0.0.0.255 ar 45
net 10.10.5.0 0.0.0.255 ar 45
exit

引入外部路由,在R4做重分发(需要做双向)

R4:
router os 1
redistribute ospf 45 subnets
exit
router os 45
redistribute ospf 1 subnets
exit