某公司网络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:

到此实验结束!!!

相关推荐
猿究院_夏燊4 分钟前
SpringMVC 到底是怎么干活的?
java·网络·职场和发展
电子制造自留地38 分钟前
AI服务器高多层PCB设计:阻抗控制、层间对位与孔金属化工程要点
大数据·网络·人工智能·科技·pcb工艺
最强小杰1 小时前
Claude Opus 4.8 调用报 529 怎么办?并发限制触发过载——退避策略与降级方案完整指南
运维·网络·python·ai
深盾科技_Virbox1 小时前
软许可、加密锁和云许可混合使用时,授权接口应该怎么统一?
运维·网络·安全
legendary_螺蛳粉2 小时前
LDR6500 国产 PD 芯片,MCU 可控切换 Type‑C Host/Device
网络
小能喵2 小时前
kismet -h 帮助信息 中文版
linux·服务器·网络
臻选云栗子2 小时前
PCDN晚高峰掉量原因分析及优化建议
服务器·网络·安全·网络安全·阿里云·云计算·信息与通信
国科安芯2 小时前
无方向脚如何既快又稳:ASC0101S 自动方向感应机理与边沿加速应用研究
网络·嵌入式硬件·低轨卫星·商业航天·抗辐射
YumiProxy2 小时前
流媒体区域内容访问:代理IP的技术原理、检测机制与稳定性优化
服务器·网络·网络协议·tcp/ip·ip
智慧光迅AINOPOL2 小时前
10~50 人规模办公网络组网技术分析:架构对比与选型参考
网络·架构·智能路由器