多区域OSPF配置

配置命令步骤:

1.使用router ospf 进程ID编号启用OSPF路由

2.使用network 直连网络地址 反掩码 area 区域号将其归于对应区域

注意:

1.进程ID编号可任意(1-65535)

2.反掩码用4个255相减得到

3.area 0 为主干区域

4.连接不同区域之间的路由器是ABR(区域边界路由器)

5.OSPF区域与其他外部路由连接之间的路由器是ASBR(自治系统边界路由器)


如下图,根据给出要求配置OSPF多区域路由,使得PC1和PC2互通:

具体配置:

一、在B路由器上配置接口的IP地址

B(config)#interface f0/1

B(config-if)#ip address 192.168.30.1 255.255.255.0

B(config-if)#no shutdown

B(config)#interface f0/0

B(config-if)#ip address 192.168.10.1 255.255.255.0

B(config-if)#no shutdown

B(config)#interface loopback 0

B(config-if)#ip address 10.1.1.1 255.0.0.0

B(config-if)#no shutdown

二、在A路由器上配置接口的IP地址

A(config)#interface f0/1

A(config-if)#ip address 192.168.10.2 255.255.255.0

A(config-if)#no shutdown

A(config)#interface f0/0

A(config-if)#ip address 192.168.20.1 255.255.255.0

A(config-if)#no shutdown

A(config)#interface loopback 0

A(config-if)#ip address 20.1.1.1 255.0.0.0

A(config-if)#no shutdown

三、在C路由器上配置IP地址

C(config)#interface f0/0

C(config-if)#ip address 192.168.20.2 255.255.255.0

C(config-if)#no shutdown

C(config)#interface f0/1

C(config-if)#ip address 192.168.40.1 255.255.255.0

C(config-if)#no shutdown

C(config)#interface loopback 0

C(config-if)#ip address 30.1.1.1 255.0.0.0

C(config-if)#no shutdown

四、为PC1和PC2配置IP地址和默认网关

五、在路由器B上配置OSPF多区域路由

B(config)#router ospf 1

B(config-router)#network 192.168.30.0 0.0.0.255 area 0

B(config-router)#network 192.168.10.0 0.0.0.255 area 0

B(config-router)#network 10.0.0.0 0.255.255.255 area 0

六、在路由器A上配置OSPF多区域路路由

A(config)#router ospf 1

A(config-router)#network 192.168.10.0 0.0.0.255 area 0

A(config-router)#network 192.168.20.0 0.0.0.255 area 1

A(config-router)#network 20.0.0.0 0.255.255.255 area 0

七、在路由器C上配置OSPF多区域路由

C(config)#router ospf 1

C(config-router)#network 192.168.20.0 0.0.0.255 area 1

C(config-router)#network 192.168.40.0 0.0.0.255 area 1

C(config-router)#network 30.0.0.0 0.255.255.255 area 1

八、验证PC1和PC2的互通性

上图表示成功互通

相关推荐
虎头金猫15 小时前
4K 视频总卡在公网带宽?用 N1 + OpenList 把网盘播放链路重新理顺
运维·服务器·网络·python·容器·beautifulsoup·pandas
wuyk55517 小时前
《WiFi 嵌入式物联网开发全套实战》| 第 16 章 ESP32 AP+STA 双模共存原理与工程坑点
网络·stm32·物联网
QYRdata19 小时前
年均增速24.2%!机器人数据湖未来六年增长动能强劲
网络·机器人·服务发现
CHENKONG_CK19 小时前
破解制鞋打磨痛点:RFID赋能去毛刺工序自动化升级
网络·单片机·嵌入式硬件·网络协议·tcp/ip
chshang199220 小时前
工业路由器是什么?浅谈5G工业网络中的IR602
网络·物联网·5g·智能路由器
萧瑟余晖20 小时前
Netty 核心组件与 Reactor 模型详解
网络·架构
ITxiaobing202320 小时前
IP 定位服务选型指南:从准确率到工程落地的技术考察
linux·服务器·网络
wuyk55520 小时前
【Socket 进阶之路】第 9 章 Linux 网络服务量产稳定性优化|心跳保活、TIME_WAIT、SO_LINGER、内存池、断线重连、完整异常防护框架
linux·服务器·开发语言·网络·物联网
z落落21 小时前
C#UDP+串口服务端+UDP 客户端(含 CRC16 校验)
网络·网络协议·udp
云运维笔记21 小时前
华为设备IP地址配置全攻略
运维·网络·计算机网络·华为