IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 系统运维 -> 华为路由器OSPF基础配置命令 -> 正文阅读

[系统运维]华为路由器OSPF基础配置命令

1.互联IP地址规则:如AR1和AR2互联就是12.1.1.1和12.1.1.2以此类推。

2.环回口配置如AR1? int lo 0 1.1.1.1 32

3.Ospf的routerID跟回环口相同方便记忆。也可以是设备里面没有的IP地址做routeid。只是一个标识。

4.宣告接口注意是只宣告自己有的接口

第一步配置接口IP和回环口地址(IP地址规则如上) ?

第二步配置ospf进程

第三步宣告ospf进程和rip进程

AR1配置回环口和接口IP

[Huawei]int LoopBack 0???????????? //进入回环口0接口(也可以是1接口)

[Huawei-LoopBack0]ip add 1.1.1.1 32? //配置IP地址

[Huawei-LoopBack0]int g0/0/0??????? //直接从回环口进入到接口0

[Huawei-GigabitEthernet0/0/0]ip add 14.1.1.1 24? //配置IP地址

[Huawei-GigabitEthernet0/0/0]int g0/0/2???????? //进入接口2

[Huawei-GigabitEthernet0/0/2]ip add 172.16.10.1 24 ?//配置IP地址(中间有交换机需要三台AR路由器有接口在一个网段)

第二步:配置ospf

[Huawei]ospf 10 router-id 1.1.1.1??? //创建ospf10 配置router-id 为1.1.1.1

[Huawei-ospf-10]area 10?????????? //进入area 10区域

[Huawei-ospf-10-area-0.0.0.10]network 172.16.10.0 0.0.0.255?? //宣告接口网段

[Huawei-ospf-10-area-0.0.0.10]network 14.1.1.0 0.0.0.255? //宣告接口网段

[Huawei-ospf-10-area-0.0.0.10]network 1.1.1.1 0.0.0.0???? //宣告回环口网段

[Huawei-ospf-10-area-0.0.0.10]dis this????????????????? //查看area10下配置的命令

[V200R003C00]

#

?area 0.0.0.10

? network 1.1.1.1 0.0.0.0

? network 14.1.1.0 0.0.0.255

? network 172.16.10.0 0.0.0.255

AR2配置回环口和接口IP地址

[Huawei]int LoopBack 0???????????? //进入回环口0接口(也可以是1接口)

[Huawei-LoopBack0]ip add 2.2.2.2 32? //配置IP地址

[Huawei-LoopBack0]int g0/0/0??????? //直接从回环口进入到接口0

[Huawei-GigabitEthernet0/0/0]ip add 172.16.10.2 24 ?//配置IP地址(中间有交换机需要三台AR路由器有接口在一个网段)

第二步:配置ospf

[Huawei]ospf 10 router-id 2.2.2.2??? //创建ospf10 配置router-id 为2.2.2.2

[Huawei-ospf-10]area 10?????????? //进入area 10区域

[Huawei-ospf-10-area-0.0.0.10]network 172.16.10.0 0.0.0.255?? //宣告接口网段

[Huawei-ospf-10-area-0.0.0.10]network 2.2.2.2 0.0.0.0???? //宣告回环口网段

AR3配置回环口和接口IP地址

[Huawei]int LoopBack 0???????????? //进入回环口0接口(也可以是1接口)

[Huawei-LoopBack0]ip add 3.3.3.3 32? //配置IP地址

[Huawei-LoopBack0]int g0/0/0??????? //直接从回环口进入到接口0

[Huawei-GigabitEthernet0/0/0]ip add 172.16.10.3 24 ?//配置IP地址(中间有交换机需要三台AR路由器有接口在一个网段)

第二步:配置ospf

[Huawei]ospf 10 router-id 3.3.3.3??? //创建ospf10 配置router-id 为3.3.3.3

[Huawei-ospf-10]area 10?????????? //进入area 10区域

[Huawei-ospf-10-area-0.0.0.10]network 172.16.10.0 0.0.0.255?? //宣告接口网段

[Huawei-ospf-10-area-0.0.0.10]network 3.3.3.3 0.0.0.0???? //宣告回环口网段

AR4(属于两个区域0和区域10)配置回环口和接口IP地址

[Huawei]int LoopBack 0???????????? //进入回环口0接口(也可以是1接口)

[Huawei-LoopBack0]ip add 4.4.4.4 32? //配置IP地址

[Huawei-LoopBack0]int g0/0/0??????? //直接从回环口进入到接口0

[Huawei-GigabitEthernet0/0/0]ip add 14.1.1.4 24 ?//配置IP地址

[Huawei-GigabitEthernet0/0/0]int g0/0/1??????? //直接从回环口进入到接口1

[Huawei-GigabitEthernet0/0/1]ip add 46.1.1.4 24 ?//配置IP地址

[Huawei-GigabitEthernet0/0/1]int g0/0/2??????? //直接从回环口进入到接口1

[Huawei-GigabitEthernet0/0/2]ip add 45.1.1.4 24 ?//配置IP地址

第二步:配置ospf

[Huawei]ospf 10 router-id 4.4.4.4??? //创建ospf10 配置router-id 为4.4.4.4

[Huawei-ospf-10]area 10?????????? //进入area 10区域

[Huawei-ospf-10-area-0.0.0.10]network 14.1.1..0 0.0.0.255?? //宣告接口网段

[Huawei]ospf 10 router-id 4.4.4.4??? //创建ospf10 配置router-id 为3.3.3.3

[Huawei-ospf-10]area 0? ??????????//进入area 0区域

[Huawei-ospf-10-area-0.0.0.0]network 45.1.1..0 0.0.0.255?? //宣告接口网段

[Huawei-ospf-10-area-0.0.0.0]network 46.1.1..0 0.0.0.255?? //宣告接口网段

AR5(直接看配置就可以配置了如果不会就看AR4的步骤)

[Huawei-ospf-10]dis ip int br

Interface???????????????????????? IP Address/Mask????? Physical?? Protocol?

GigabitEthernet0/0/0????????????? 56.1.1.5/24????????? up???????? up???????

GigabitEthernet0/0/1????????????? 45.1.1.5/24????????? up???????? up???????

GigabitEthernet0/0/2????????????? 57.1.1.5/24????????? up???????? up???????

LoopBack0??????????????? ????????5.5.5.5/32??????? ?up??? ?????up(s)

配置opsf

[Huawei-ospf-10]dis this

[V200R003C00]

#

ospf 10 router-id 5.5.5.5

?area 0.0.0.0

? network 5.5.5.5 0.0.0.0

? network 45.1.1.0 0.0.0.255

? network 56.1.1.0 0.0.0.255

?area 0.0.0.20

? network 57.1.1.0 0.0.0.255

#

return

AR6配置

配置接口

<Huawei>dis ip int br

Interface???????????????????????? IP Address/Mask????? Physical?? Protocol?

GigabitEthernet0/0/0????????????? 46.1.1.6/24????????? up???????? up???????

GigabitEthernet0/0/1????????????? 56.1.1.6/24????????? up???????? up???????

GigabitEthernet0/0/2???? ?????????unassigned????????? down???? down?????

LoopBack0???????????????????????? 6.6.6.6/32???????? up????? up(s)????

配置ospf

[Huawei-ospf-10]dis this

[V200R003C00]

#

ospf 10 router-id 6.6.6.6

?area 0.0.0.0

? network 6.6.6.6 0.0.0.0

? network 46.1.1.0 0.0.0.255

? network 56.1.1.0 0.0.0.255

AR7配置

接口配置

<Huawei>dis ip int br

Interface???????????????????????? IP Address/Mask????? Physical?? Protocol?

GigabitEthernet0/0/0????????????? 57.1.1.7/24????????? up???????? up???????

GigabitEthernet0/0/1????????????? 78.1.1.7/24????????? up???????? up???????

GigabitEthernet0/0/2????????????? unassigned?????? ??down????? down?????

LoopBack0???????????????????????? 7.7.7.7/32?????????? up?????? up(s)

AR8(需要配置两个协议sopf和rip)最后还需要宣告路由ospf的路由宣告到rip 。rip的路由宣告到ospf?

接口配置

[Huawei]dis ip int br

Interface???????????????????????? IP Address/Mask????? Physical?? Protocol?

GigabitEthernet0/0/0????????????? 78.1.1.8/24????????? up???????? up???????

GigabitEthernet0/0/1????????????? 89.1.1.8/24????????? up???? ????up???????

GigabitEthernet0/0/2????????????? unassigned?????????? down????? down?????

LoopBack0???????????????????????? 8.8.8.8/32?????????? up??????? up(s)?

Ospf配置(路由引入单独配置了不在dis this命令里面)

[Huawei-ospf-10]dis this

[V200R003C00]

#

ospf 10 router-id 8.8.8.8

?area 0.0.0.20

? network 8.8.8.8 0.0.0.0

? network 78.1.1.0 0.0.0.255

rip配置

[Huawei-rip-1]dis this

[V200R003C00]

#

rip 1?????????????????? //进入RIP默认是1

?undo summary???????? //关闭自动聚合

?version 2?????????????? //选择版本V2

?network 89.0.0.0???????? //宣告网段

?import-route ospf 10???? //

配置路由引入

[Huawei]ospf 10?????????

[Huawei-ospf-10]import-route rip ??//rip引入到ospf10里面

[Huawei-ospf-10]rip????????????? //进入rip?????????????

[Huawei-rip-1]import-route ospf 10? //ospf10引入到rip

AR9配置(只需要配置rip也不用引入配置,因为是边界路由器)

配置接口信息

<Huawei>dis ip int br??? //查看接口IP信息

Interface???????????????????????? IP Address/Mask????? Physical?? Protocol?

GigabitEthernet0/0/0????????????? 89.1.1.9/24????????? up???????? up???????

GigabitEthernet0/0/1????????????? unassigned?????????? down?????? down?????

GigabitEthernet0/0/2????????????? unassigned?????????? down?????? down?????

LoopBack0???????????????????????? 9.9.9.9/32?????????? up???????? up(s)

配置rip

[Huawei-rip-1]dis this

[V200R003C00]

#

rip 1

?version 2

?network 89.0.0.0

?network 9.0.0.0

#

return

[Huawei]dis ip routing-table protocol rip?????? //查看路由

Route Flags: R - relay, D - download to fib

------------------------------------------------------------------------------

Public routing table : RIP

???????? Destinations : 15?????? Routes : 15??????

RIP routing table status : <Active>

???????? Destinations : 15?????? Routes : 15

Destination/Mask??? Proto?? Pre? Cost????? Flags NextHop???????? Interface

??????? 1.1.1.1/32? RIP???? 100? 1?????????? D?? 89.1.1.8??????? GigabitEthernet

0/0/0

??????? 2.2.2.2/32? RIP???? 100? 1?????????? D ??89.1.1.8??????? GigabitEthernet

0/0/0

??????? 3.3.3.3/32? RIP???? 100? 1?????????? D?? 89.1.1.8??????? GigabitEthernet

0/0/0

??????? 4.4.4.4/32? RIP???? 100? 1?????????? D?? 89.1.1.8??????? GigabitEthernet

0/0/0

??????? 5.5.5.5/32? RIP???? 100? 1??????? ???D?? 89.1.1.8??????? GigabitEthernet

0/0/0

??????? 6.6.6.6/32? RIP???? 100? 1?????????? D?? 89.1.1.8??????? GigabitEthernet

0/0/0

??????? 7.7.7.7/32? RIP???? 100? 1?????????? D?? 89.1.1.8??????? GigabitEthernet

0/0/0

??????? 8.8.8.8/32? RIP???? 100? 1?? ????????D?? 89.1.1.8??????? GigabitEthernet

0/0/0

?????? 14.1.1.0/24? RIP???? 100? 1?????????? D?? 89.1.1.8??????? GigabitEthernet

0/0/0

?????? 45.1.1.0/24? RIP???? 100? 1?????????? D?? 89.1.1.8??????? GigabitEthernet

0/0/0

?????? 46.1.1.0/24? RIP???? 100 ?1?????????? D?? 89.1.1.8??????? GigabitEthernet

0/0/0

?????? 56.1.1.0/24? RIP???? 100? 1?????????? D?? 89.1.1.8??????? GigabitEthernet

0/0/0

?????? 57.1.1.0/24? RIP???? 100? 1?????????? D?? 89.1.1.8??????? GigabitEthernet

0/0/0

?????? 78.1.1.0/24? RIP???? 100? 1?????????? D?? 89.1.1.8??????? GigabitEthernet

0/0/0

??? 172.16.10.0/24? RIP???? 100? 1?????????? D?? 89.1.1.8??????? GigabitEthernet

0/0/0

RIP routing table status : <Inactive>

???????? Destinations : 0??????? Routes : 0

验证命令

[Huawei]dis ospf peer br????????????? //查看OSPf的邻居表

??????? ?OSPF Process 10 with Router ID 4.4.4.4

??????????????? ? Peer Statistic Information

?----------------------------------------------------------------------------

?Area Id????????? Interface??????????????????????? Neighbor id????? State???

?0.0.0.0????????? GigabitEthernet0/0/2???????????? 5.5.5.5????????? Full???????

?0.0.0.0????????? GigabitEthernet0/0/1???????????? 6.6.6.6????????? Full???????

?0.0.0.10???????? GigabitEthernet0/0/0???????????? 1.1.1.1????????? Full???????

?----------------------------------------------------------------------------

[Huawei]

<AR1>display ospf interface???????????? //查看OSPF接口宣告情况

<AR1>display ospf lsdb??????????????? //查看OSPF的链路状态数据库(拓扑表)

?

  系统运维 最新文章
配置小型公司网络WLAN基本业务(AC通过三层
如何在交付运维过程中建立风险底线意识,提
快速传输大文件,怎么通过网络传大文件给对
从游戏服务端角度分析移动同步(状态同步)
MySQL使用MyCat实现分库分表
如何用DWDM射频光纤技术实现200公里外的站点
国内顺畅下载k8s.gcr.io的镜像
自动化测试appium
ctfshow ssrf
Linux操作系统学习之实用指令(Centos7/8均
上一篇文章      下一篇文章      查看所有文章
加:2022-06-20 23:09:26  更:2022-06-20 23:10:53 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年5日历 -2024/5/19 0:07:21-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码