OSPF支持Hub-And-Spoke組網典型配置舉例
關鍵詞:OSPF、Hub-And-Spoke
摘 要:Hub-And-Spoke組網是一種典型的網絡扁平化組網方案。為了使OSPF協議能夠更好地支持Hub-And-Spoke組網,H3C對OSPF協議進行的一係列優化。本文描述了OSPF用於Hub-And-Spoke組網的配置過程。
縮略語:
縮略語 | 英文全名 | 中文解釋 |
LSA | Link State Advertisement | 鏈路狀態通告 |
LSDB | Link State Database | 鏈路狀態數據庫 |
OSPF | Open Shortest Path First | 開放最短路徑優先 |
目 錄
Hub-And-Spoke組網是一種典型的網絡扁平化組網方案,通過Hub設備下連接數量眾多的Spoke設備來實現。
OSPF協議支持Hub-And-Spoke組網時,網絡規劃通常將Hub設備與所有的Spoke設備規劃在同一個OSPF區域內,Hub設備與所有的Spoke設備之間維持OSPF鄰居關係。此時,Hub設備鄰居數量眾多,占用大量係統資源,有可能會出現鄰居超時、網絡收斂時間比較長、影響其他業務正常運行等等問題。
通過對OSPF協議進行優化配置,可以很大程度上緩解這些問題。
l 有一個具有500個Spoke設備的Hub-And-Spoke組網,Hub設備(Router A)通過OSPF協議與Spoke設備(Router B、Router C、Router D和Router E等)交換路由信息,且所有設備處於同一個OSPF區域中。
l Spoke設備通過Hub設備訪問文件服務器。
設備 | 接口 | IP地址 | 設備 | 接口 | IP地址 |
Router A | Eth1/1 | 10.1.1.1/24 | Router B | Eth1/1 | 10.1.1.2/24 |
| Eth1/2 | 10.1.2.1/24 | Router C | Eth1/1 | 10.1.2.2/24 |
| Eth1/3 | 10.1.3.1/24 | Router D | Eth1/1 | 10.1.3.2/24 |
| Eth1/4 | 10.1.4.1/24 | Router E | Eth1/1 | 10.1.4.2/24 |
| Eth1/5 | 20.1.1.1/24 | Server |
| 20.1.1.2/24 |
圖1 OSPF支持Hub-And-Spoke配置組網圖
l 配置OSPF優先接收和處理Hello報文。
l 配置接口發送LSU報文的時間間隔和每次最多發送的LSU報文數,保證報文平緩發送。
l 配置LSA重新生成的最大時間間隔、最小時間間隔和懲罰增量,控製LSA的生成。
l 配置SPF計算最大時間間隔、最小時間間隔和懲罰增量,控製進行SPF計算的時間間隔。
以下配置均是在實驗室環境下進行的配置和驗證,配置前設備的所有參數均采用出廠時的缺省配置。如果您已經對設備進行了配置,為了保證配置效果,請確認現有配置和以下配置不衝突。
本文檔不嚴格與具體軟、硬件版本對應。
# 啟動OSPF同時指定Router ID並進入OSPF視圖。
<RouterA> system-view
[RouterA] ospf 1 router-id 1.1.1.1
# 配置OSPF區域1所包含的網段並在指定網段的接口上使能OSPF。
[RouterA-ospf-1] area 1
[RouterA-ospf-1-area-0.0.0.1] network 10.0.0.0 0.255.255.255
[RouterA-ospf-1-area-0.0.0.1] network 20.1.1.0 0.0.0.255
[RouterA-ospf-1-area-0.0.0.1] quit
# 配置OSPF優先接收和處理Hello報文。
[RouterA] ospf packet-process prioritized-treatment
# 配置接口發送LSU報文的時間間隔為200毫秒,每次最多10個LSU報文。
[RouterA] ospf 1 router-id 1.1.1.1
[RouterA-ospf-1] transmit-pacing interval 200 count 10
# 配置LSA重新生成的最大時間間隔為60秒,最小時間間隔為1000毫秒,懲罰增量為1000毫秒。
[RouterA-ospf-1] lsa-generation-interval 60 1000 1000
# 配置SPF計算最大時間間隔為60秒,最小時間間隔為1000毫秒,懲罰增量為1000毫秒。
[RouterA-ospf-1] spf-schedule-interval 60 1000 1000
<RouterA> display current-configuration
#
version 5.20, Beta 1501L02, Standard
#
sysname RouterA
#
configure-user count 50
#
info-center logfile size-quota 0
#
domain default enable system
#
telnet server enable
#
radius scheme system
server-type extended
primary authentication 127.0.0.1 1645
primary accounting 127.0.0.1 1646
user-name-format without-domain
#
domain system
access-limit disable
state active
idle-cut disable
self-service-url disable
#
interface Aux0
async mode flow
link-protocol ppp
#
interface Ethernet1/1
port link-mode route
ip address 10.1.1.1 255.255.255.0
#
interface Ethernet1/2
port link-mode route
ip address 10.1.2.1 255.255.255.0
#
interface Ethernet1/3
port link-mode route
ip address 10.1.3.1 255.255.255.0
#
interface Ethernet1/4
port link-mode route
ip address 10.1.4.1 255.255.255.0
#
interface Ethernet1/5
port link-mode route
ip address 20.1.1.1 255.255.255.0
#
#...(此處略去若幹相似接口配置)
#
ospf packet-process prioritized-treatment
#
ospf 1 router-id 1.1.1.1
spf-schedule-interval 60 1000 1000
lsa-generation-interval 60 1000 1000
transmit-pacing interval 200 count 10
area 0.0.0.1
network 10.0.0.0 0.255.255.255
network 20.1.1.0 0.0.0.255
#
user-interface con 0
user-interface aux 0
authentication-mode none
user privilege level 3
user-interface vty 0 4
authentication-mode none
user privilege level 3
#
Router B、Router C等Spoke設備配置非常類似,這裏以Router B為例對Spoke設備的配置進行說明,其它Spoke設備的配置不再贅述。
# 啟動OSPF同時指定Router ID並進入OSPF視圖。
<RouterB> system-view
[RouterB] ospf 1 router-id 2.2.2.2
# 指定運行OSPF協議的接口Ethernet1/1的IP地址位於網段10.0.0.0/24,接口所在的OSPF區域ID為1。
[RouterB-ospf-1] area 1
[RouterB-ospf-1-area-0.0.0.1] network 10.0.0.0 0.255.255.255
<RouterB> display current-configuration
#
version 5.20, Beta 1501L02, Standard
#
sysname RouterB
#
configure-user count 50
#
info-center logfile size-quota 0
#
domain default enable system
#
telnet server enable
#
radius scheme system
server-type extended
primary authentication 127.0.0.1 1645
primary accounting 127.0.0.1 1646
user-name-format without-domain
#
domain system
access-limit disable
state active
idle-cut disable
self-service-url disable
#
interface Aux0
async mode flow
link-protocol ppp
#
interface Ethernet1/1
port link-mode route
ip address 10.1.1.2 255.255.255.0
#
ospf 1 router-id 2.2.2.2
area 0.0.0.1
network 10.0.0.0 0.255.255.255
#
user-interface con 0
user-interface aux 0
authentication-mode none
user privilege level 3
user-interface vty 0 4
authentication-mode none
user privilege level 3
#
按照如上配置,Hub設備與Spoke設備在區域1形成Full的鄰居關係,Spoke設備學習到Hub設備發布的Server所在網段的路由。
<RouterA> display ospf peer statistics
OSPF Process 1 with Router ID 1.1.1.1
Neighbor Statistics
Area ID Down Attempt Init 2-Way ExStart Exchange Loading Full Total
0.0.0.1 0 0 0 0 0 0 0 500 500
Total 0 0 0 0 0 0 0 500 500
可以看出,Router A共有500個鄰居(狀態都為Full)。
<RouterB> display ospf peer
OSPF Process 1 with Router ID 2.2.2.2
Neighbor Brief Information
Area: 0.0.0.1
Router ID Address Pri Dead-Time Interface State
1.1.1.1 10.1.1.1 1 35 Eth1/1 Full/BDR
可以看出,Router B的鄰居路由器為Router A。
<RouterB> display ip routing-table
Routing Tables: Public
Destinations : 5 Routes : 5
Destination/Mask Proto Pre Cost NextHop Interface
10.1.1.0/24 Direct 0 0 10.1.1.2 Eth1/1
10.1.1.2/32 Direct 0 0 127.0.0.1 InLoop0
20.1.1.0/24 OSPF 10 2 10.1.1.1 Eth1/1
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
可以看出,Router B到達文件服務器的下一跳為Router A,即通過Router A訪問文件服務器。
l RFC 2328:OSPF Version 2
l RFC 4222:Prioritized Treatment of Specific OSPF Version 2 Packets and Congestion Avoidance
OSPF支持Hub-And-Spoke組網技術白皮書
Copyright ©2009 杭州華三通信技術有限公司 版權所有,保留一切權利。
非經本公司書麵許可,任何單位和個人不得擅自摘抄、複製本文檔內容的部分或全部,並不得以任何形式傳播。
本文檔中的信息可能變動,恕不另行通知。