一、拓扑图
二、实验内容
即任意两个ip地址之间都可以互相通信
注意:每个路由器的router id 都为自己的环
回接口。
三、配置方式:
1、所有接口地址配置(略)
2、各路由器的配置
R6:
router id 6.6.6.6
ospf 1 router-id 6.6.6.6
silent-interface GigabitEthernet0/0/1 // 将与电脑相接的端口配置成静默端口,禁止此接口接收和发送OSPF报文,这样可以增强OSPF 的组网适应能力,减少系统资源的消耗。
preference 20
area 0.0.0.5 //按规划配置好区域
network 6.6.6.0 0.0.0.255
network 16.1.1.0 0.0.0.255
network 192.168.2.0 0.0.0.255
R1:
router id 1.1.1.1
interface Serial4/0/0 //两边串口相连,配置PPP链路,加快收敛
link-protocol ppp
ip address 12.1.1.1 255.255.255.0
#
ospf 1 router-id 1.1.1.1
area 0.0.0.1 //area1做为连接STUB区域与骨干区域的纽带,配置VLINK,便于STUB区域接收来自骨干区域的OSPF路由。
network 1.1.1.0 0.0.0.255
network 12.1.1.0 0.0.0.255
vlink-peer 2.2.2.2
area 0.0.0.5
network 16.1.1.0 0.0.0.255
R2:
router id 2.2.2.2
interface Serial4/0/0
link-protocol ppp
ip address 12.1.1.2 255.255.255.0
ospf 1 router-id 2.2.2.2
area 0.0.0.0
network 2.2.2.0 0.0.0.255
network 23.1.1.0 0.0.0.255
area 0.0.0.1
network 12.1.1.0 0.0.0.255
vlink-peer 1.1.1.1 //与R1建立VLINK连接
R3:
router id 3.3.3.3
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 3.3.3.0 0.0.0.255
network 23.1.1.0 0.0.0.255
area 0.0.0.2
network 192.168.1.0 0.0.0.255
R4:
router id 4.4.4.4
ospf 1 router-id 4.4.4.4
area 0.0.0.2
network 4.4.4.0 0.0.0.255
network 192.168.1.0 0.0.0.0
network 192.168.1.0 0.0.0.255
R5:
router id 5.5.5.5
interface LoopBack2
ip address 8.8.8.8 255.255.255.0
#
ospf 1 router-id 5.5.5.5
import-route rip 1
area 0.0.0.2
network 5.5.5.0 0.0.0.255
network 192.168.1.0 0.0.0.255
#
rip 1
version 2
network 8.0.0.0
import-route ospf 1
RIP和OSPF互相引入,保证链路和路由相通