華三交換機H3C單區域OSPF典型配置案例

寰宇001發表於2020-05-23

轉載來源 : 單區域OSPF典型配置案例 :
https://mp.weixin.qq.com/s/Gxnb2q0DeWgZd9lLMGXKjg

組網及說明

在實際組網中,經常會遇到OSPF組網的案例,比如單區域OSPF、多區域OSPF、OSPF虛鏈路、OSPF NSSA、OSPF STUB等需求,以下是多區域OSPF典型組網的配置案例。

網路拓撲圖:

在這裡插入圖片描述
互聯地址、業務地址、looback0地址如上圖所示,全網均採用OSPF程式1、其中R1與R2路由器屬於OSPF的區域0,R2與R3路由器屬於OSPF區域1,實現全網互聯互通。

配置步驟

1、配置loopback0地址

2、配置各互聯地址

3、建立OSPF程式1,並將各地址在區域0中釋出

4、檢視OSPF鄰居的狀態

5、測試PC之間能互聯互通

配置關鍵點

R1:

<H3C>system-view

[H3C]sysname R1

[R1]int LoopBack 0

[R1-LoopBack0]ip add

[R1-LoopBack0]ip address 1.1.1.1 32

[R1-LoopBack0]quit

[R1]int gi 0/0

[R1-GigabitEthernet0/0]ip address 192.168.1.1 24

[R1-GigabitEthernet0/0]description <connect to PC>

[R1-GigabitEthernet0/0]quit

[R1]int gi 0/1

[R1-GigabitEthernet0/1]ip address 10.0.0.1 30

[R1-GigabitEthernet0/1]description <connect to R2>

[R1-GigabitEthernet0/1]quit

[R1]ospf 1 router-id 1.1.1.1

[R1-ospf-1]area 0.0.0.0

[R1-ospf-1-area-0.0.0.0]network 10.0.0.1 0.0.0.0

[R1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0

[R1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255

[R1-ospf-1-area-0.0.0.0]quit

[R1-ospf-1]quit

R2:

<H3C>system-view

[H3C]sysname R2

[R2]int LoopBack 0

[R2-LoopBack0]ip address 2.2.2.2 32

[R2-LoopBack0]quit

[R2]int gi 0/0

[R2-GigabitEthernet0/0]ip address 10.0.0.2 30

[R2-GigabitEthernet0/0]description <connect to R1>

[R2-GigabitEthernet0/0]quit

[R2]int gi 0/1

[R2-GigabitEthernet0/1]description <connect to R3>

[R2-GigabitEthernet0/1]ip address 10.0.0.5 30

[R2-GigabitEthernet0/1]quit

[R2]ospf 1 router-id 2.2.2.2

[R2-ospf-1]area 0.0.0.0

[R2-ospf-1-area-0.0.0.0]network 10.0.0.2 0.0.0.0

[R2-ospf-1-area-0.0.0.0]network 10.0.0.5 0.0.0.0

[R2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0

[R2-ospf-1-area-0.0.0.0]quit

[R2-ospf-1]quit

R3:

<H3C>system-view

[H3C]sysname R3

[R3]int LoopBack 0

[R3-LoopBack0]ip address 3.3.3.3 32

[R3-LoopBack0]quit

[R3]int gi 0/0

[R3-GigabitEthernet0/0]description <connect to PC>

[R3-GigabitEthernet0/0]ip address 172.16.1.1 24

[R3-GigabitEthernet0/0]quit

[R3]int gi 0/1

[R3-GigabitEthernet0/1]description <connect to R2>

[R3-GigabitEthernet0/1]ip address 10.0.0.6 30

[R3-GigabitEthernet0/1]quit

[R3]ospf 1 router-id 3.3.3.3

[R3-ospf-1]area 0.0.0.0

[R3-ospf-1-area-0.0.0.0]network 10.0.0.6 0.0.0.0

[R3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0

[R3-ospf-1-area-0.0.0.0]network 172.16.1.0 0.0.0.255

[R3-ospf-1-area-0.0.0.0]quit

[R3-ospf-1]quit

測試各路由器的OSPF鄰居建立情況:

R1>dis ospf peer



         OSPF Process 1 with Router ID 1.1.1.1

               Neighbor Brief Information



 Area: 0.0.0.0

 Router ID       Address         Pri Dead-Time  State             Interface

 2.2.2.2         10.0.0.2        1   37         Full/BDR          GE0/1

<R1>



<R2>dis ospf peer



         OSPF Process 1 with Router ID 2.2.2.2

               Neighbor Brief Information



 Area: 0.0.0.0

 Router ID       Address         Pri Dead-Time  State             Interface

 1.1.1.1         10.0.0.1        1   39         Full/DR           GE0/0

 3.3.3.3         10.0.0.6        1   34         Full/BDR          GE0/1

<R2>



[R3]dis ospf peer



         OSPF Process 1 with Router ID 3.3.3.3

               Neighbor Brief Information



 Area: 0.0.0.0

 Router ID       Address         Pri Dead-Time  State             Interface

 2.2.2.2         10.0.0.5        1   37         Full/DR           GE0/1

[R3]

PC之間能PING通:
在這裡插入圖片描述
在這裡插入圖片描述
在這裡插入圖片描述
在這裡插入圖片描述
至此單區域OSPF配置已完成!

相關文章