某公司网络OSPF单区域配置

1.配置背景:

xx公司网络由三台路由器和一台交换机组成,现在想要三台路由器之间通过OSPF实现互连互通。

2.网络结构如下:

3.具体配置:

3.1路由器 RA 配置:

1.更改主机名称:

复制代码
Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname RA
RA(config)#

2.配置接口IP:

复制代码
RA(config)#interface g0/0
RA(config-if)#ip address 192.168.1.1 255.255.255.0
RA(config-if)#no shutdown 

RA(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up

RA(config-if)#
RA(config-if)#exit
RA(config)#interface loopback 0

RA(config-if)#
%LINK-5-CHANGED: Interface Loopback0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up

RA(config-if)#ip add
RA(config-if)#ip address 192.168.31.11 255.255.255.255
RA(config-if)#exit

3.启动OSPF进程并进行宣告:

复制代码
RA(config)#router ospf 1 # 启动OSPF进程,进程号为1,本地有效
RA(config-router)#router-id 192.168.31.11 # 配置路由器ID,一般使用环回接口地址
RA(config-router)#network 192.168.31.11 0.0.0.0 area 0 # 宣告环回接口网段
RA(config-router)#network 192.168.1.0 0.0.0.255 area 0 # 宣告直连网段,反掩码0.0.0.255,区域0

4.保存配置:

复制代码
RA(config)#do wr
Building configuration...
[OK]

3.2路由器 RB 配置:

1.更改主机名称:

复制代码
Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname RB
RB(config)#

2.配置接口IP:

复制代码
RB(config)#interface g0/0
RB(config-if)#ip address 192.168.1.2 255.255.255.0
RB(config-if)#no shutdown 

RB(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up
RB(config-if)#exit
RB(config)#interface lo
RB(config)#interface loopback 0

RB(config-if)#
%LINK-5-CHANGED: Interface Loopback0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up

RB(config-if)#ip address 192.168.31.22 255.255.255.255
RB(config-if)#exit

3.启动OSPF进程并进行宣告:

复制代码
RB(config)#router ospf 1
RB(config-router)#router-id 192.168.31.22
RB(config-router)#network 192.168.1.0 0.0.0.255 area 0
RB(config-router)#network 192.168.31.22 0.0.0.0 area 0
RB(config-router)#exit

4.保存配置:

复制代码
RB(config)#do wr
Building configuration...
[OK]

3.3路由器 RC 配置:

1.更改主机名称:

复制代码
Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname RC
RC(config)#

2.配置接口IP:

复制代码
RC(config)#interface g0/0
RC(config-if)#ip address 192.168.1.3 255.255.255.0
RC(config-if)#no shutdown 

RC(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up

RC(config-if)#
RC(config-if)#exit
RC(config)#interface loopback 0

RC(config-if)#
%LINK-5-CHANGED: Interface Loopback0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up

RC(config-if)#ip address 192.168.31.33 255.255.255.255
RC(config-if)#exit

3.启动OSPF进程并进行宣告:

复制代码
RC(config)#router ospf 1
RC(config-router)#router-id 192.168.31.33
RC(config-router)#network 192.168.31.33 0.0.0.0 area 0
RC(config-router)#network 192.168.1.0 0.0.0.255 area 0
RC(config-router)#exit

4.保存配置:

复制代码
RC(config)#do wr
Building configuration...
[OK]

4.验证:

4.1查看RA\AB\RC邻居关系:

4.2查看RA\RB\RC路由表:

5.测试:

5.1RC访问RA和RB:

5.2RA访问RB和RC:

5.3RB访问RA和RC:

到此实验结束!!!

相关推荐
humors2211 小时前
筑牢个人信息的安全防线
网络·安全·泄露·隐私·个人信息·保护
德迅--文琪4 小时前
主机安全工具科普:德迅安全卫士(德迅卫士)
网络·安全
数字新视界4 小时前
动环智能监控历史数据留存与故障回溯方法
运维·服务器·网络·机房·模块化机房
奇墨 ITQM4 小时前
AI网关MAIGateway怎么判断质量?多活切换实测
大数据·网络·人工智能·高可用·ai网关·故障切换
遥夜人间4 小时前
Nginx 纳入 systemd 管理
运维·网络·nginx
fruge5 小时前
ClipSketch AI视频转手绘故事板实战:关键帧选取、Gemini绘图与文案生成
网络·网络协议·http
lijie2357 小时前
第81天 网络问题
网络
To Be Clean Coder8 小时前
【往事如风】从「缝缝补补」到领域隔离:一次策略下发模块的重构
网络·安全·重构
都在酒里8 小时前
嵌入式台架自动化:用 Python 回归测试 RS-485 和 CAN
网络·python·自动化
鲁邦通物联网10 小时前
IACS UR E27系统取证证据链设计:海事网关、应用软件与集成测试分工
运维·网络·集成测试·海事网关·船用网关·海事网络安全·智慧航运