当前位置:网站首页>华为路由器:多区域OSPF协议实验
华为路由器:多区域OSPF协议实验
2022-07-15 19:51:00 【健忘的老菜鸟】
对于新手而言,要想不迷糊,就得先把图画好。该标的都标在图上,这样才会减少出错的几率。
注意:我们给每个路由器配置一个LoopBack接口,用来做routeID.
基础配置
先安装拓扑图把IP配置好,后面我们在进行OSPF的配置。为了测试效果,我们给每个路由器上面再配置一个LoopBack
AR1
<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]sy ar1
[ar1]int g0/0/0
[ar1-GigabitEthernet0/0/0]ip add 12.1.1.1 24
Jul 12 2022 15:58:20-08:00 ar1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[ar1-GigabitEthernet0/0/0]q
[ar1]int lo 0
[ar1-LoopBack0]ip add 1.1.1.1 24
[ar1-LoopBack0]q
AR2
[Huawei]sy ar2
[ar2]int g0/0/0
[ar2-GigabitEthernet0/0/0]
[ar2-GigabitEthernet0/0/0]ip add 12.1.1.2 24
Jul 12 2022 16:01:15-08:00 ar2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[ar2-GigabitEthernet0/0/0]q
[ar2]int g0/0/1
[ar2-GigabitEthernet0/0/1]ip add 23.1.1.2 24
Jul 12 2022 16:01:45-08:00 ar2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[ar2-GigabitEthernet0/0/1]q
AR3
<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]sy ar3
[ar3]
[ar3]int g0/0/0
[ar3-GigabitEthernet0/0/0]ip add 23.1.1.3 24
Jul 12 2022 16:10:30-08:00 ar3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[ar3-GigabitEthernet0/0/0]q
[ar3]int g0/0/1
[ar3-GigabitEthernet0/0/1]ip add 192.168.1.3 24
Jul 12 2022 16:10:49-08:00 ar3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[ar3-GigabitEthernet0/0/1]q
[ar3]
[ar3]int LoopBack 0
[ar3-LoopBack0]ip add 3.3.3.3 24
[ar3-LoopBack0]q
AR4
<Huawei>
<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]sy ar4
[ar4]
[ar4]int g0/0/0
[ar4-GigabitEthernet0/0/0]ip add 192.168.1.4 24
Jul 12 2022 16:17:49-08:00 ar4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[ar4-GigabitEthernet0/0/0]q
[ar4]int LoopBack 0
[ar4-LoopBack0]ip add 4.4.4.4 24
[ar4-LoopBack0]q
[ar4]
[ar4]
AR5
<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]sy ar5
[ar5]in g0/0/0
[ar5-GigabitEthernet0/0/0]ip add 192.168.1.5 24
Jul 12 2022 16:20:30-08:00 ar5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[ar5-GigabitEthernet0/0/0]q
[ar5]int LoopBack 0
[ar5-LoopBack0]ip add 5.5.5.5 24
[ar5-LoopBack0]q
[ar5]int LoopBack 1
[ar5-LoopBack1]ip add 8.8.8.8 24
[ar5-LoopBack1]q
[ar5]
二、OSPF的配置
配置之前我们先复习一下OSPF的语法:
ospf 1 router-id x.x.x.x #自治区域ID和router-id
area 1 #区域ID:1、0、2
network 12.1.1.0 0.0.0.255 #宣告网段
q
AR1
[ar1]ospf router-id 1.1.1.1
[ar1-ospf-1]area 1
[ar1-ospf-1-area-0.0.0.1]network 12.1.1.0 0.0.0.255
[ar1-ospf-1-area-0.0.0.1]network 1.1.1.0 0.0.0.255
[ar1-ospf-1-area-0.0.0.1]
AR2
[ar2]ospf router-id 2.2.2.2
[ar2-ospf-1]area 1
[ar2-ospf-1-area-0.0.0.1]network 12.1.1.0 0.0.0.255
[ar2-ospf-1-area-0.0.0.1]q
[ar2-ospf-1]
[ar2-ospf-1]area 0
[ar2-ospf-1-area-0.0.0.0]network 23.1.1.0 0.0.0.255
[ar2-ospf-1-area-0.0.0.0]network 2.2.2.0 0.0.0.255
[ar2-ospf-1-area-0.0.0.0]q
[ar2-ospf-1]
AR3
[ar3]ospf router-id 3.3.3.3
[ar3-ospf-1]area 0
[ar3-ospf-1-area-0.0.0.0]network 23.1.1.0 0.0.0.255
[ar3-ospf-1-area-0.0.0.0]network 3.3.3.0 0.0.0.255
[ar3-ospf-1-area-0.0.0.0]q
[ar3-ospf-1]area 2
[ar3-ospf-1-area-0.0.0.2]network 192.168.1.0 0.0.0.255
[ar3-ospf-1-area-0.0.0.2]
[ar3-ospf-1-area-0.0.0.2]
AR4
[ar4]ospf router-id 4.4.4.4
[ar4-ospf-1]area 2
[ar4-ospf-1-area-0.0.0.2]network 192.168.1.0 0.0.0.255
[ar4-ospf-1-area-0.0.0.2]network 4.4.4.0 0.0.0.255
[ar4-ospf-1-area-0.0.0.2]
AR5
[ar5]ospf router-id 5.5.5.5
[ar5-ospf-1]area 2
[ar5-ospf-1-area-0.0.0.2]network 192.168.1.0 0.0.0.255
[ar5-ospf-1-area-0.0.0.2]network 5.5.5.0 0.0.0.255
[ar5-ospf-1-area-0.0.0.2]q
[ar5-ospf-1]q
[ar5]q
三、查看OSPF
查看R1的整个路由表
<ar1>dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 16 Routes : 16
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.0/24 Direct 0 0 D 1.1.1.1 LoopBack0
1.1.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
1.1.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
2.2.2.2/32 OSPF 10 1 D 12.1.1.2 GigabitEthernet0/0/0
3.3.3.3/32 OSPF 10 2 D 12.1.1.2 GigabitEthernet0/0/0
4.4.4.4/32 OSPF 10 3 D 12.1.1.2 GigabitEthernet0/0/0
5.5.5.5/32 OSPF 10 3 D 12.1.1.2 GigabitEthernet0/0/0
12.1.1.0/24 Direct 0 0 D 12.1.1.1 GigabitEthernet0/0/0
12.1.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
12.1.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
23.1.1.0/24 OSPF 10 2 D 12.1.1.2 GigabitEthernet0/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.1.0/24 OSPF 10 3 D 12.1.1.2 GigabitEthernet0/0/0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
仅查看ospf的路由
<ar1>dis ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
Destinations : 6 Routes : 6
OSPF routing table status : <Active>
Destinations : 6 Routes : 6
Destination/Mask Proto Pre Cost Flags NextHop Interface
2.2.2.2/32 OSPF 10 1 D 12.1.1.2 GigabitEthernet0/0/0
3.3.3.3/32 OSPF 10 2 D 12.1.1.2 GigabitEthernet0/0/0
4.4.4.4/32 OSPF 10 3 D 12.1.1.2 GigabitEthernet0/0/0
5.5.5.5/32 OSPF 10 3 D 12.1.1.2 GigabitEthernet0/0/0
23.1.1.0/24 OSPF 10 2 D 12.1.1.2 GigabitEthernet0/0/0
192.168.1.0/24 OSPF 10 3 D 12.1.1.2 GigabitEthernet0/0/0
OSPF routing table status : <Inactive>
Destinations : 0 Routes : 0
查看R1邻居表
<ar1>dis ospf peer brief
OSPF Process 1 with Router ID 1.1.1.1
Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.1 GigabitEthernet0/0/0 2.2.2.2 Full
----------------------------------------------------------------------------
边栏推荐
- 电商爬虫API全面详解
- 要想不踩SaaS那些坑,得先了解“SaaS架构”
- 6-Redis架构设计到使用场景-持久化机制、缓存失效策略、缓存命中率
- C writes the database connection mode to the configuration file
- 日志的管理与应急处理
- liquibase初次使用
- Can you use redis? Then come and learn about redis protocol
- 浅析电子签章应用安全与技术
- 4-Redis架构设计到使用场景-Redis请求执行过程
- The correlation between BTC and technology stocks weakened, and market uncertainty increased? 53% of investors will turn to alternative assets
猜你喜欢

Airiot Q & A issue 4 | how to use data analysis engine?

Codeforces Round #802 B. Palindromic Numbers

迪赛智慧数——折(渐变堆叠图):全国居民人均可支配收入

Codeforces Round #804 C The Third Problem

Codeforces Round #802 B. Palindromic Numbers
![[ArcGIS creates a small picture frame of islands and nine segment lines in the South China Sea]](/img/5e/5d81afb511d22214a2545121f22300.png)
[ArcGIS creates a small picture frame of islands and nine segment lines in the South China Sea]

Codeforces Round #804 A The Third Three Number Problem

Cloud document management software docuware cloud how to solve five it problems

【空间&单细胞组学】第2期:联合单细胞和bulk转录组鉴定了结直肠癌中两种上皮肿瘤细胞状态,并完善了CMS分型

LeetCode-14-最长公共前缀
随机推荐
4-Redis架构设计到使用场景-Redis请求执行过程
sql语句
Leetcode-62-different paths
Massive remote sensing data processing and the practical application of GEE cloud computing technology
Is it really safe for Huatai Securities to open an account?
日志服务器的配置
5个时间序列预测的深度学习模型对比总结:从模拟统计模型到可以预训练的无监督模型
LeetCode-240-搜索二维矩阵Ⅱ
Input device drive process
Tengshi's new luxury medium and large MPV is exposed, safe and comfortable
Codeforces Round #802 B. Palindromic Numbers
【空间&单细胞组学】第2期:乳腺癌患者经anti-PD1治疗后,肿瘤内变化的单细胞图谱
访问控制设定
Codeforces Round #803 (Div. 2) D. Fixed Point Guessing
SQL也能玩转AI ?没错!MLOps Meetup V3 回顾|OpenMLBD+SQLFlow+Byzer
[mt2109] rectangle
Codeforces Global Round 21 A. NIT orz!
nacos win10单机启动命令
电商爬虫API全面详解
【MT2126】 数字游戏