Cisco实验中ospf协议区域及虚电路结构基本配置

ospf基本配置

ospf实验例图

各接口及路由器虚拟地址配置以下说明
==R1:虚拟地址lo0:1.1.1.1 s0/0:12.1.1.1
R2:虚拟地址lo0:2.2.2.2 lo1:22.22.22.22 s0/0:12.1.1.2 s0/1:23.1.1.2
R3:虚拟地址lo0:3.3.3.3 lo1:33.33.33.33 s0/1:23.1.1.3 s0/2:34.1.1.3
R4:虚拟地址lo0:4.4.4.4 s0/2:34.1.1.4 ==

对R1进行配置
R1#conf t
R1(config)#int lo0
R1(config-if)#ip add
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config-if)#no sh
R1(config)#int s0/0
R1(config-if)#ip add 12.1.1.1 255.255.255.0
R1(config-if)#no sh

R1(config)#router ospf 1
R1(config-router)#router-id 1.1.1.1
R1(config-router)#network 1.1.1.1 0.0.0.0 area 0
R1(config-router)#network 12.1.1.1 0.0.0.0 area 0

对R2进行基本配置
R2#conf t
R2(config)#int lo0
R2(config-if)#ip add 2.2.2.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#int s0/0
R2(config-if)#ip add 12.1.1.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#int s0/1
R2(config-if)#ip add 23.1.1.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#int lo1
R2(config-if)#ip add 22.22.22.22 255.255.255.0
R2(config-if)#no sh
R2(config-if)#end

R2(config)#router ospf 1
R2(config-router)#router-id 2.2.2.2
R2(config-router)#network 2.2.2.2 0.0.0.0 area 0
R2(config-router)#network 22.22.22.22 0.0.0.0 area 1
R2(config-router)#network 12.1.1.2 0.0.0.0 area 0
R2(config-router)#network 23.1.1.2 0.0.0.0 area 1

对R3进行配置
R3#conf t
R3(config)#int lo0
R3(config-if)#ip add 3.3.3.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#int lo1
R3(config-if)#ip add 33.33.33.33 255.255.255.0
R3(config-if)#no sh
R3(config-if)#int s0/1
R3(config-if)#ip add 23.1.1.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#int s0/2
R3(config-if)#ip add 34.1.1.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#end

R3(config)#router ospf 1
R3(config-router)#router-id 3.3.3.3
R3(config-router)#network 3.3.3.3 0.0.0.0 area 1
R3(config-router)#network 33.33.33.33 0.0.0.0 area 2
R3(config-router)#network 23.1.1.3 0.0.0.0 area 1
R3(config-router)#network 34.1.1.3 0.0.0.0 area 2

对R4进行配置
R4#conf t
R4(config)#int lo0
R4(config-if)#ip add 4.4.4.4 255.255.255.0
R4(config-if)#no sh
R4(config-if)#int s0/2
R4(config-if)#ip add 34.1.1.4 255.255.255.0
R4(config-if)#no sh
R4(config-if)#end

R4(config)#route
R4(config)#router ospf 1
R4(config-router)#router-id 4.4.4.4
R4(config-router)#network 4.4.4.4 0.0.0.0 area 2
R4(config-router)#network 34.1.1.4 0.0.0.0 area 2
R4(config-router)#end

配置完成后观察各路由器路由条目
R1
在这里插入图片描述
R2
在这里插入图片描述
R3
在这里插入图片描述
R4
在这里插入图片描述
此时ospf区域配置实现,并发现R4、R1各自路由表中没有对方地址,因为R1在区域0,R4在区域2,中间多一个区域1,且0区域才为核心区域,所以此时可以使用虚电路将R2、R3实现虚电路,则R1、R4可实现通信,虚电路配置如下

R2
在这里插入图片描述
R3
在这里插入图片描述

之后再观察各路由表,会发现R1、R4之间会连通
在这里插入图片描述
在这里插入图片描述
注意,因为OSPF非核心区域的之间传递路由必须要通过区域0(核心区域),所以才会用到虚电路技术。

  • 3
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值