晚上好,我是老楊。

之前我更新了第一篇OSPF的圖解《圖解OSPF,看這70張圖已經足夠(一) 》,因為眾多粉絲催更,12月初就加更第二期圖解內容,只為讓你一飽眼福。

作為網絡基礎,瞭解它是你入門精進的第一步。

01 LSA(Link-State Advertisements)

01 OSPF路由器的種類

ospf 起源_網絡

02 虛擬鏈路

(1)定義虛擬鏈路

ospf 起源_智能路由器_02

(2)配置虛擬鏈路

ospf 起源_網絡_03

配置案例:

ospf 起源_ospf 起源_04

ospf 起源_網絡_05

03 LSA的類型

ospf 起源_華為認證_06

(1)Type 1: Router LSA

ospf 起源_網絡工程師_07

(2)Type 2: Network LSA

ospf 起源_智能路由器_08

(3)Type 3: Summary LSA

ospf 起源_智能路由器_09

  • Type 3 LSAs用於將本區域產生的LSA 信息泛洪道其它區域:描述鏈路的網絡號和掩碼。
  • 由起始區域的ABR產生並通告。
  • Type 3 LSAs被其它的ABR泛洪到整個自治系統。
  • 默認情況下,路由不進行彙總。類型3 LSA將通告到每個子網。

(4)Type 4: Summary LSA

ospf 起源_ospf 起源_10

  • Summary (type 4) LSAs are 被用於在整個自制系統向其它區域通告ASBR
  • Type 4 LSA 由原始區域的ABR產生。
  • Type 4 LSA 被其它的ABR泛洪到整個自治系統。
  • Type 4 LSAs 包含ASBR的Router ID。

(5)Type 5:External LSA

  • External (type 5) LSAs 被用來通告來自其他自治系統網絡。
  • Type 5 LSA 始源於ASBR產生並由ASBR通告
  • Type 5 LSAs 在整個自治系統泛洪。
  • 在整個自治系統泛洪中,通告的 router ID (ASBR) 不變。
  • 類型4的LSA用於找到ASBR。
  • 默認情況下,路由不進行彙總。

04 OSPF 路由條目類型

Interpreting the Routing Table: Types of Routes

ospf 起源_網絡_11

Calculating Costs for E1 and E2 Routes

ospf 起源_網絡工程師_12

05 OSPF LSDB 過載保護

ospf 起源_網絡_13

  • 通過其他路由器生成的LSA過多可能會耗盡本地路由器資源.
  • 這個特性能夠限制不是自己生成的LSA.
  • maximum-number:不是自己產生的LSA.
  • threshold-percentage:達到多大比例以後將發出警告:默認為75%
  • [warning-only]:只發出警告,而OSPF不會進入忽略狀態.默認被禁用.
  • [ignore-time minutes]:超過最大LSA數量限制後,忽略所有鄰居的時間,默認為5分鐘.
  • [ignore-count count-number]:指定OSPF進程可連續進⼊入忽略狀態的次數,默認為5次.
  • [reset-time minutes]:指定多長時間後將忽略計數器重置為0,默認為10分鐘

02 OSPF 路由彙總

  • 彙總好處
  • 配置OSPF路由彙總
  • 配置OSPF默認路由

01 路由彙總的好處

ospf 起源_ospf 起源_14

ospf 起源_ospf 起源_15

02 配置OSPF路由彙總

ospf 起源_華為認證_16

(1)配置案例:ABR

ospf 起源_ospf 起源_17

(2)配置案例:ASBR

ospf 起源_智能路由器_18

03 配置OSPF的默認路由

ospf 起源_智能路由器_19

(1)配置案例

ospf 起源_智能路由器_20

(2)配置 OSPF 特殊區域

  • Stub
  • Totally Stub
  • NSSA
  • NSSA Totally Stubby

使用Stub區域:

ospf 起源_智能路由器_21

Stub區域配置:

ospf 起源_ospf 起源_22

OSPF Stub區域配置案例:

ospf 起源_ospf 起源_23

Using Totally Stubby Areas:

ospf 起源_華為認證_24

• External LSAs are stopped.

• Summary LSAs are stopped.

• Routing table is reduced to a minimum.

• All routers must be configured as stub.

• ABR must be configured as totally stubby.

• This is a Cisco proprietary feature.

ospf 起源_華為認證_25

Totally Stubby Configuration Example:

ospf 起源_智能路由器_26

Not-So-Stubby Areas:

ospf 起源_網絡_27

• NSSA breaks stub area rules.

• ASBR (R1) is allowed in NSSA.

• Special LSA type 7 defined, sent by ASBR.

• ABR (R2) converts LSA type 7 to LSA type 5.

• ABR sends default route into NSSA instead of external routes from other ASBRs.

• NSSA is an RFC addendum.

配置NSSA:

• 使用此命令定義區域為NSSA區域。

• 關鍵字no-summary 用於創建一個NSSA完全末節區域; 這是Cisco的私有特效。

配置NSSA的案例:

ospf 起源_ospf 起源_28

NSSA Totally Stubby Configuration:

ospf 起源_ospf 起源_29

show Commands for Stub and NSSA:

ospf 起源_網絡_30

03 配置OSPF認證

01 OSPF認證類型

OSPF支持2種認證類型:

  • Simple password (or plain text) authentication
  • MD5 authentication

路由器生成並檢查每一個OSPF報文。路由器驗證它接收每個路由更新報文的源。

配置一個“密鑰”(密碼);每個參與的鄰居必須配置相同的密鑰。

(1)配置OSPF Simple Password Authentication

ospf 起源_ospf 起源_31

配置案例:

ospf 起源_ospf 起源_32

(2)配置OSPF MD5 Authentication

ospf 起源_智能路由器_33

配置案例:

ospf 起源_華為認證_34

Troubleshooting Simple Password Authentication Problems:

ospf 起源_網絡工程師_35

Troubleshooting MD5 Authentication:

ospf 起源_華為認證_36

OSPF認證密碼規律:

ospf 起源_ospf 起源_37

整理:老楊丨10年資深網絡工程師