多區域OSPF典型配置案例

組網及說明

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

網絡拓撲圖:


多區域OSPF典型配置案例


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

配置步驟

  1. 配置loopback0地址
  2. 配置各互聯地址
  3. 創建OSPF進程1,並將各地址在區域0中發佈
  4. 查看OSPF鄰居的狀態
  5. 測試PC之間能互聯互通

配置關鍵點

R1:
<code>

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

 

 

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

 

 

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

/<code>
R2:
<code>

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

 

 

to

 

R1>

[R2-GigabitEthernet0/0]quit

[R2]int

 

gi

 

0

/1

[R2-GigabitEthernet0/1]description

 

 

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

 

2.2

.2

.2

 

0.0

.0

.0

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

[R2-ospf-1]area

 

0.0

.0

.1

[R2-ospf-1-area-0.0.0.1]network

 

10.0

.0

.5

 

0.0

.0

.0

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

[R2-ospf-1]quit

/<code>
R3:
<code>

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

 

 

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

 

 

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

.1

[R3-ospf-1-area-0.0.0.1]network

 

10.0

.0

.6

 

0.0

.0

.0

[R3-ospf-1-area-0.0.0.1]network

 

3.3

.3

.3

 

0.0

.0

.0

[R3-ospf-1-area-0.0.0.1]network

 

172.16

.1

.0

 

0.0

.0

.255

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

[R3-ospf-1]quit

/<code>
測試各路由器的OSPF鄰居建立情況:
<code>

[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

   

31

         

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

   

35

         

Full/DR

           

GE0/0

 

Area:

 

0.0

.0

.1

 

Router

 

ID

       

Address

         

Pri

 

Dead-Time

  

State

             

Interface

 

3.3

.3

.3

         

10.0

.0

.6

        

1

   

33

         

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

.1

 

Router

 

ID

       

Address

         

Pri

 

Dead-Time

  

State

             

Interface

 

2.2

.2

.2

         

10.0

.0

.5

        

1

   

32

         

Full/DR

           

GE0/1

[R3]

/<code>
PC之間能PING通:
多區域OSPF典型配置案例


多區域OSPF典型配置案例


多區域OSPF典型配置案例


多區域OSPF典型配置案例

至此多區域OSPF配置已完成!


分享到:


相關文章: