【华为路由】OSPF多区域配置

网络拓扑

设备接口地址

|-----|------------|-------------|
| 设备 | 端口 | IP地址 |
| RTA | Loopback 0 | 1.1.1.1/32 |
| RTA | G0/0/0 | 10.1.1.1/24 |
| RTB | Loopback 0 | 2.2.2.2/32 |
| RTB | G0/0/0 | 10.1.1.2/24 |
| RTB | G0/0/1 | 10.1.2.1/24 |
| RTC | Loopback 0 | 3.3.3.3/32 |
| RTC | G0/0/0 | 10.1.2.2/24 |
| RTC | G0/0/1 | 10.1.3.1/24 |
| RTD | Loopback 0 | 4.4.4.4/32 |
| RTD | G0/0/0 | 10.1.3.2/24 |

配置过程

1.基本配置

RTA

<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname RTA
[RTA]interface LoopBack 0
[RTA-LoopBack0]ip address 1.1.1.1 32
[RTA-LoopBack0]quit 
[RTA]interface GigabitEthernet 0/0/0
[RTA-GigabitEthernet0/0/0]ip address 10.1.1.1 24
[RTA-GigabitEthernet0/0/0]quit 
[RTA]

RTB

<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname RTB
[RTB]interface LoopBack 0
[RTB-LoopBack0]ip address 2.2.2.2 32
[RTB-LoopBack0]quit 
[RTB]interface GigabitEthernet 0/0/0
[RTB-GigabitEthernet0/0/0]ip address 10.1.1.2 24
[RTB-GigabitEthernet0/0/0]quit 
[RTB]interface GigabitEthernet 0/0/1
[RTB-GigabitEthernet0/0/1]ip address 10.1.2.1 24	
[RTB-GigabitEthernet0/0/1]quit 
[RTB]

RTC

<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname RTC
[RTC]interface LoopBack 0
[RTC-LoopBack0]ip address 3.3.3.3 32
[RTC-LoopBack0]quit 
[RTC]interface GigabitEthernet 0/0/0
[RTC-GigabitEthernet0/0/0]ip address 10.1.2.2 24
[RTC-GigabitEthernet0/0/0]quit 
[RTC]interface GigabitEthernet 0/0/1
[RTC-GigabitEthernet0/0/1]ip address 10.1.3.1 24
[RTC-GigabitEthernet0/0/1]quit 
[RTC]

RTD

<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname RTD
[RTD]interface LoopBack 0
[RTD-LoopBack0]ip address 4.4.4.4 32
[RTD-LoopBack0]quit 
[RTD]interface GigabitEthernet 0/0/0
[RTD-GigabitEthernet0/0/0]ip address 10.1.3.2 24
[RTD-GigabitEthernet0/0/0]quit 
[RTD]

2.OSPF配置

RTA

[RTA]router id 1.1.1.1
[RTA]ospf 1
[RTA-ospf-1]area 1
[RTA-ospf-1-area-0.0.0.1]network 1.1.1.1 0.0.0.0
[RTA-ospf-1-area-0.0.0.1]network 10.1.1.0 0.0.0.255
[RTA-ospf-1-area-0.0.0.1]return
<RTA>save
  The current configuration will be written to the device. 
  Are you sure to continue? (y/n)[n]:y
  It will take several minutes to save configuration file, please wait.......
  Configuration file had been saved successfully
  Note: The configuration file will take effect after being activated
<RTA>

RTB

[RTB]router id 2.2.2.2
[RTB]ospf 1
[RTB-ospf-1]area 0
[RTB-ospf-1-area-0.0.0.0]network 10.1.2.0 0.0.0.255
[RTB-ospf-1-area-0.0.0.0]quit
[RTB-ospf-1]area 1
[RTB-ospf-1-area-0.0.0.1]network 2.2.2.2 0.0.0.0
[RTB-ospf-1-area-0.0.0.1]network 10.1.1.0 0.0.0.255
[RTB-ospf-1-area-0.0.0.1]return
<RTB>save
  The current configuration will be written to the device. 
  Are you sure to continue? (y/n)[n]:y
  It will take several minutes to save configuration file, please wait.......
  Configuration file had been saved successfully
  Note: The configuration file will take effect after being activated
<RTB>

RTC

[RTC]router id 3.3.3.3
[RTC]ospf 1
[RTC-ospf-1]area 0
[RTC-ospf-1-area-0.0.0.0]network 10.1.2.0 0.0.0.255
[RTC-ospf-1-area-0.0.0.0]quit 
[RTC-ospf-1]area 2
[RTC-ospf-1-area-0.0.0.2]network 3.3.3.3 0.0.0.0
[RTC-ospf-1-area-0.0.0.2]network 10.1.3.0 0.0.0.255
[RTC-ospf-1-area-0.0.0.2]return
<RTC>save
  The current configuration will be written to the device. 
  Are you sure to continue? (y/n)[n]:y
  It will take several minutes to save configuration file, please wait.......
  Configuration file had been saved successfully
  Note: The configuration file will take effect after being activated
<RTC>

RTD

[RTD]router id 4.4.4.4
[RTD]ospf 1
[RTD-ospf-1]area 2
[RTD-ospf-1-area-0.0.0.2]network 4.4.4.4 0.0.0.0
[RTD-ospf-1-area-0.0.0.2]network 10.1.3.0 0.0.0.255
[RTD-ospf-1-area-0.0.0.2]return
<RTD>
<RTD>save
  The current configuration will be written to the device. 
  Are you sure to continue? (y/n)[n]:y
  It will take several minutes to save configuration file, please wait.......
  Configuration file had been saved successfully
  Note: The configuration file will take effect after being activated
<RTD>

结果验证

相关推荐
李洋-蛟龙腾飞公司4 小时前
HarmonyOS Next 应用元服务开发-应用接续动态配置迁移按需迁移页面
华为·harmonyos
JasonYin~5 小时前
HarmonyOS NEXT 实战之元服务:静态案例效果---查看手机历史记录
华为·harmonyos
我要学编程(ಥ_ಥ)5 小时前
初始JavaEE篇 —— 网络原理---传输层协议:深入理解UDP/TCP
java·网络·tcp/ip·udp·java-ee
百事可乐☆5 小时前
全局webSocket 单个页面进行监听并移除单页面监听
网络·websocket·网络协议
深圳启明云端科技5 小时前
WiFi、蓝牙共存,物联网无线通信技术,设备无线连接数据传输应用
网络·物联网·智能家居
No Silver Bullet5 小时前
HarmonyOS NEXT开发进阶(五):装饰器讲解
华为·harmonyos
dengjiayue6 小时前
OSI 网络 7 层模型
网络
cnsinda_sdc6 小时前
信创数据防泄漏中信创沙箱是什么样的安全方案
运维·网络·安全·源代码管理·源代码防泄密·源代码加密
深圳启明云端科技7 小时前
潮玩设备AI语音交互方案,ESP32-S3芯片模组物联网通信技术
网络·物联网·音视频·智能家居
搬砖的果果7 小时前
爬虫代理服务要怎么挑选?
网络·爬虫·网络协议·tcp/ip