1. 程式人生 > >華為路由器配置OSPF

華為路由器配置OSPF

切換 system-v 線程 his 鏈路 ron ESS 設備配置 alt

OSPF是什麽

OSPF(Open Shortest Pass First,開放最短路徑優先協議),是一個最常用的內部網管協議,是一個鏈路狀態協議。

使用場景:適用於運營商、政府機構等大型網絡中多節點要求互聯互通

網絡結構:支持兩層結構 1骨幹區域 2 子區域

OSPF基於IP

OSPF不屬於網絡層協議

技術分享圖片

PC12 配置好IP信息後啟動

技術分享圖片

PC13 同樣操作配置好IP信息後啟動

技術分享圖片

路由設備配置部分

技術分享圖片

R6 基礎環境配置

<Huawei>system-view #切換模式

技術分享圖片

[Huawei]sysname R6 #給設備起個名字

R6

[R6]display ip interface brief #查看設備接口信息

技術分享圖片

[R6]int GigabitEthernet 0/0/0 #進入 GE 0 接口

[R6]ip add 10.0.1.1 24 #配置IP

[R6]q #退出並返回上一級目錄

[R6]int GigabitEthernet 0/0/1

[R6-GigabitEthernet0/0/1]ip add 20.0.2.1 24

[R6-GigabitEthernet0/0/1]

[R6-GigabitEthernet0/0/1]display ip interface brief

技術分享圖片

R8 基礎環境配置

<Huawei>

<Huawei>system-view #切換模式

Enter system view, return user view with Ctrl+Z.

[Huawei]

[Huawei]sysname R8 #給設備起個名字 R8

[R8]

[R8]int GigabitEthernet 0/0/0 #進入 GE 0 接口

[R8-GigabitEthernet0/0/0]

[R8-GigabitEthernet0/0/0]ip add 20.0.2.2 24 #配置IP

[R8-GigabitEthernet0/0/0]

Mar 6 2019 11:07:24-08:00 R8 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP

on the interface GigabitEthernet0/0/0 has entered the UP state.

[R8-GigabitEthernet0/0/0]

[R8-GigabitEthernet0/0/0]int GigabitEthernet 0/0/1 #進入 GE 1 接口

[R8-GigabitEthernet0/0/1]

[R8-GigabitEthernet0/0/1]ip add 30.0.3.2 24 #配置IP

Mar 6 2019 11:08:48-08:00 R8 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP

on the interface GigabitEthernet0/0/1 has entered the UP state.

[R8-GigabitEthernet0/0/1]q #退出並返回上一級目錄

[R8]

[R8]interface LoopBack0

[R8-LoopBack0]q #退出並返回上一級目錄

[R8]

[R8]interface LoopBack0 #配置回環口 0

[R8-LoopBack0]ip add 6.6.6.6 24 #配置IP

[R8-LoopBack0]q #退出並返回上一級目錄

[R8]

[R8]display ip interface brief #查看設備接口信息

*down: administratively down

^down: standby

(l): loopback

(s): spoofing

The number of interface that is UP in Physical is 4

The number of interface that is DOWN in Physical is 0

The number of interface that is UP in Protocol is 4

The number of interface that is DOWN in Protocol is 0

Interface IP Address/Mask Physical Protocol

GigabitEthernet0/0/0 20.0.2.2/24 up up

GigabitEthernet0/0/1 30.0.3.2/24 up up

LoopBack0 6.6.6.6/24 up up(s)

NULL0 unassigned up up(s)

R9 基礎環境配置

<Huawei>SY

<Huawei>system-view

Enter system view, return user view with Ctrl+Z.

[Huawei]

[Huawei]SY

[Huawei]sysname R9

[R9]

[R9]int

[R9]interface gi

[R9]interface GigabitEthernet 0/0/0

[R9-GigabitEthernet0/0/0]ip add 30.0.3.3 24

[R9-GigabitEthernet0/0/0]

Mar 6 2019 11:20:22-08:00 R9 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP

on the interface GigabitEthernet0/0/0 has entered the UP state.

[R9-GigabitEthernet0/0/0]interface GigabitEthernet 0/0/1

[R9-GigabitEthernet0/0/1]ip add 60.0.6.3 24

Mar 6 2019 11:20:55-08:00 R9 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP

on the interface GigabitEthernet0/0/1 has entered the UP state.

[R9-GigabitEthernet0/0/1]q

[R9]

[R9]display ip interface brief

*down: administratively down

^down: standby

(l): loopback

(s): spoofing

The number of interface that is UP in Physical is 3

The number of interface that is DOWN in Physical is 0

The number of interface that is UP in Protocol is 3

The number of interface that is DOWN in Protocol is 0

Interface IP Address/Mask Physical Protocol

GigabitEthernet0/0/0 30.0.3.3/24 up up

GigabitEthernet0/0/1 60.0.6.3/24 up up

NULL0 unassigned up up(s)

[R9]

[R9]

OSPF配置部分

R6 配置OSPF

技術分享圖片

R8 配置OSPF

<R8>system-view #切換模式

Enter system view, return user view with Ctrl+Z.

[R8]

[R8]ospf 2 #創建OSPF線程2

[R8-ospf-2]area 6 #創建區域 6

[R8-ospf-2-area-0.0.0.6]network 20.0.2.0 255.255.255.0 #宣告網段

[R8-ospf-2-area-0.0.0.6]network 30.0.3.0 255.255.255.0 #宣告網段

[R8-ospf-2-area-0.0.0.6]network 6.6.6.6 255.255.255.0 #宣告網段

[R8-ospf-2-area-0.0.0.6]q #退出並返回上一級目錄

[R8-ospf-2]

[R8-ospf-2]display this #查看設備接口信息

[V200R003C00]

#

ospf 2

area 0.0.0.6

network 6.6.6.0 0.0.0.255

network 20.0.2.0 0.0.0.255

network 30.0.3.0 0.0.0.255

#

return

[R8-ospf-2]

R9 配置OSPF

技術分享圖片

華為路由器配置OSPF