当前位置: 首页 > ds >正文

【eNSP实验】带环回接口的多区域OSPF

拓扑图

如下图,需要配置ospf协议让R1~R8这些设备全部ping通,路由器需配置环回接口。

配置

R3配置如下

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sys R3
//配置环回接口地址(先配置,RouterID就会默认是环回接口地址)
[R3]int loopback 0
[R3-LoopBack0]ip add 3.3.3.3 32
//配置其他端口地址
[R3-LoopBack0]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 10.1.1.1 24
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 10.1.2.1 24
//查看RouterID
[R3-GigabitEthernet0/0/1]dis router id
RouterID:3.3.3.3
//配置ospf
[R3-GigabitEthernet0/0/1]ospf 1
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 10.1.2.0 0.0.0.255
//退出保存配置
[R3-ospf-1-area-0.0.0.0]q
[R3-ospf-1]q
[R3]q
<R3>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]:
Now saving the current configuration to the slot 17.
Save the configuration successfully.
<R3>

R4配置如下

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sys R4
[R4]int loopback 0
[R4-LoopBack0]ip add 4.4.4.4 32
[R4-LoopBack0]int g0/0/0
[R4-GigabitEthernet0/0/0]ip add 10.1.4.2 24
[R4-GigabitEthernet0/0/0]int g0/0/1
[R4-GigabitEthernet0/0/1]ip add 10.1.1.2 24
[R4-GigabitEthernet0/0/1]dis router id
RouterID:4.4.4.4
[R4-GigabitEthernet0/0/1]ospf 1
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255
[R4-ospf-1-area-0.0.0.0]network 10.1.4.0 0.0.0.255
[R4-ospf-1-area-0.0.0.0]q
[R4-ospf-1]q
[R4]q
<R4>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]:
Now saving the current configuration to the slot 17.
Save the configuration successfully.

R5配置如下

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sys R5
[R5]int loopback 0
[R5-LoopBack0]ip add 5.5.5.5 32
[R5-LoopBack0]int g0/0/0
[R5-GigabitEthernet0/0/0]ip add 10.2.1.2 24
[R5-GigabitEthernet0/0/0]dis router id
RouterID:5.5.5.5
[R5-GigabitEthernet0/0/0]ospf 1
//注意这里的区域设置为2
[R5-ospf-1]area 2
[R5-ospf-1-area-0.0.0.2]network 10.2.1.0 0.0.0.255
[R5-ospf-1-area-0.0.0.2]q
[R5-ospf-1]q
[R5]q
<R5>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]:
Now saving the current configuration to the slot 17.
Save the configuration successfully.

R6配置如下

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sys R6
[R6]int loopback 0
[R6-LoopBack0]ip add 6.6.6.6 32
[R6-LoopBack0]int g0/0/0
[R6-GigabitEthernet0/0/0]ip add 10.2.2.2 24
[R6-GigabitEthernet0/0/0]dis router id
RouterID:6.6.6.6
[R6-GigabitEthernet0/0/0]ospf 1
[R6-ospf-1]area 2
[R6-ospf-1-area-0.0.0.2]network 10.2.2.0 0.0.0.255
[R6-ospf-1-area-0.0.0.2]q
[R6-ospf-1]q
[R6]q
<R6>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]:
Now saving the current configuration to the slot 17.
Save the configuration successfully.

R7配置如下

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sys R7
[R7]int loopback 0
[R7-LoopBack0]ip add 7.7.7.7 32
[R7-LoopBack0]int g0/0/0
[R7-GigabitEthernet0/0/0]ip add 10.3.1.2 24
[R7-GigabitEthernet0/0/0]dis router id
RouterID:7.7.7.7
[R7-GigabitEthernet0/0/0]ospf 1
//注意这里区域配置为1
[R7-ospf-1]area 1
[R7-ospf-1-area-0.0.0.1]network 10.3.1.0 0.0.0.255
[R7-ospf-1-area-0.0.0.1]q
[R7-ospf-1]q
[R7]q
<R7>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]:
Now saving the current configuration to the slot 17.
Save the configuration successfully.

R8配置如下

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sys R8
[R8]int loopback 0
[R8-LoopBack0]ip add 8.8.8.8 32
[R8-LoopBack0]int g0/0/0
[R8-GigabitEthernet0/0/0]ip add 10.3.2.2 24
[R8-GigabitEthernet0/0/0]dis router id
RouterID:8.8.8.8
[R8-GigabitEthernet0/0/0]ospf 1
[R8-ospf-1]area 1
[R8-ospf-1-area-0.0.0.1]network 10.3.2.0 0.0.0.255
[R8-ospf-1-area-0.0.0.1]q
[R8-ospf-1]q
[R8]q
<R8>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]:
Now saving the current configuration to the slot 17.
Save the configuration successfully.

R1配置如下

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sys R1
[R1]int loopback 0
[R1-LoopBack0]ip add 1.1.1.1 32
[R1-LoopBack0]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 10.1.3.1 24
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 10.1.2.2 24
[R1-GigabitEthernet0/0/1]int g0/0/2
[R1-GigabitEthernet0/0/2]ip add 10.2.1.1 24
[R1-GigabitEthernet0/0/2]int g0/0/3
[R1-GigabitEthernet0/0/3]ip add 10.2.2.1 24
[R1-GigabitEthernet0/0/3]dis router id
RouterID:1.1.1.1
[R1-GigabitEthernet0/0/3]ospf 1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 10.1.2.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]network 10.1.3.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]area 2
[R1-ospf-1-area-0.0.0.2]network 10.2.1.0 0.0.0.255
[R1-ospf-1-area-0.0.0.2]network 10.2.2.0 0.0.0.255
[R1-ospf-1-area-0.0.0.2]q
[R1-ospf-1]q
[R1]q
<R1>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]:
Now saving the current configuration to the slot 17.
Save the configuration successfully.

R2配置如下

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sys R2
[R2]int loopback 0
[R2-LoopBack0]ip add 2.2.2.2 32
[R2-LoopBack0]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 10.1.3.2 24
[R2-GigabitEthernet0/0/0]int g0/0/1
[R2-GigabitEthernet0/0/1]ip add 10.1.4.1 24
[R2-GigabitEthernet0/0/1]int g0/0/2
[R2-GigabitEthernet0/0/2]ip add 10.3.1.1 24
[R2-GigabitEthernet0/0/2]int g0/0/3
[R2-GigabitEthernet0/0/3]ip add 10.3.2.1 24
[R2-GigabitEthernet0/0/3]dis router id
RouterID:2.2.2.2
[R2-GigabitEthernet0/0/3]ospf 1
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 10.1.3.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]network 10.1.4.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]area 1
[R2-ospf-1-area-0.0.0.1]network 10.3.1.0 0.0.0.255
[R2-ospf-1-area-0.0.0.1]network 10.3.2.0 0.0.0.255
[R2-ospf-1-area-0.0.0.1]q
[R2-ospf-1]q
[R2]q
<R2>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]:
Now saving the current configuration to the slot 17.
Save the configuration successfully.

验证

各个路由器之间互相ping测试,发现都可以ping通。说明实验成功。

问题排查

若出现无法ping通的现象,可以使用如下命令进行排查

//查看路由表
dis ip routing
//查看ospf邻居
dis ospf peer

http://www.xdnf.cn/news/986.html

相关文章:

  • 黑马安装docker网络问题linux
  • OpenCV day7
  • 制作一款打飞机游戏16:空间优化
  • 生产环境问题排查:日志分析与性能瓶颈定位(一)
  • [wifiI]CCA
  • 关于QTableWidget控件中不显示Item的问题解决方法
  • 速通FlinkCDC3.0
  • 【数字图像处理】图像纹理分析
  • 使用 Vue Router 和 Vite 构建的自动路由生成系统
  • 基于unsloth微调一个越狱大模型
  • 经典文献阅读之--Kinematic-ICP(动态优化激光雷达与轮式里程计融合)
  • Spark,配置hadoop集群2
  • set、multiset、map、multimap在OJ的使用
  • 深度学习预训练和微调
  • 在Ubuntu上查看PCL(Point Cloud Library)的版本
  • MSSQL-数据库还原报错-‘32(另一个程序正在使用此文件,进程无法访问。)‘
  • Cursor可视化大屏搭建__0420
  • java及mysql日期问题
  • RPA系统应用通用文字识别技术,推动 RPA 在各个领域的广泛应用和发展
  • 公有云攻防5(云函数)
  • Java学习手册:Cookie 与 Session 管理
  • 用全新发布的ChatGPT-o3搜文献写综述、专业审稿、降重润色,四个步骤轻松搞定全部论文难题!
  • 电子电器架构 ---软件定义汽车的电子/电气(E/E)架构
  • RolmOCR重磅开源:基于Qwen2.5-VL,速度提升40%,手写/倾斜文档识别准确率超92%
  • 基于定时器查询模式的LED闪烁(STC89C52单片机)
  • MCP:AI时代的“万能插座”,开启大模型无限可能
  • 策略模式:优雅应对多变的业务需求
  • 【论文阅读23】-地下水预测-TCN-LSTM-Attention(2024-11)
  • ZYNQ异构架构精髓:AXI_BRAM赋能PS-PL协同计算的终极指南
  • CATIA高效工作指南——零件建模篇(一)