本產品的文件集力求使用無偏見用語。針對本文件集的目的,無偏見係定義為未根據年齡、身心障礙、性別、種族身分、民族身分、性別傾向、社會經濟地位及交織性表示歧視的用語。由於本產品軟體使用者介面中硬式編碼的語言、根據 RFP 文件使用的語言,或引用第三方產品的語言,因此本文件中可能會出現例外狀況。深入瞭解思科如何使用包容性用語。
思科已使用電腦和人工技術翻譯本文件,讓全世界的使用者能夠以自己的語言理解支援內容。請注意,即使是最佳機器翻譯,也不如專業譯者翻譯的內容準確。Cisco Systems, Inc. 對這些翻譯的準確度概不負責,並建議一律查看原始英文文件(提供連結)。
本文說明如何在介面上針對 IPv6 啟用優先開啟最短路徑 (OSPF) 版本 3。
在介面上為IPv6啟用OSPF之前,必須:
完成OSPF網路策略並規劃IPv6網路。例如,確定是否需要多個區域。
啟用IPv6單播路由。
在介面上啟用IPv6。
在OSPF for IPv6上配置IP安全(IPsec)安全套接字應用程式介面(API),以啟用身份驗證和加密。
本文件所述內容不限於特定軟體和硬體版本。
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
如需文件慣例的詳細資訊,請參閱思科技術提示慣例。
開放最短路徑優先 (OSPF) 是一種 IP 路由通訊協定。它是鏈路狀態協定,與距離向量協定相反。
鏈路狀態協定根據連線源電腦和目的電腦的鏈路狀態做出路由決策。
鏈路的狀態描述該介面及其與其相鄰網路裝置的關係。
介面資訊包括介面的IPv6字首、網路掩碼、所連線的網路型別、所連線的路由器等。
此資訊在各種型別的鏈路狀態通告(LSA)中傳播。RFC 2740中介紹的OSPF第3版支援IPv6。
本節提供用於設定本文件中所述功能的資訊。
附註:使用命令查詢工具/a>查詢有關本文檔中使用的命令的詳細資訊。
附註:只有註冊思科使用者才能訪問內部思科工具和資訊。
此文件使用以下網路設定:
這是圖中所示路由器的OSPFv3配置:
末節路由器 |
---|
ipv6 unicast-routing ipv6 cef ! interface GigabitEthernet0/0 no ip address ipv6 address FD01:ABAB::/64 eui-64 |
ABR1路由器 |
---|
ipv6 unicast-routing ipv6 cef ! interface GigabitEthernet1 no ip address speed auto ipv6 address FD03::1/124 ipv6 enable ipv6 ospf 1 area 0 ! interface GigabitEthernet2 no ip address ipv6 address FD02:ABAB::/64 eui-64 ipv6 enable ipv6 ospf 1 area 2 |
ASBR路由器 |
---|
ipv6 unicast-routing ipv6 cef ! interface GigabitEthernet1 no ip address ipv6 address FD03::2/124 ipv6 enable ipv6 ospf 1 area 0 ! interface GigabitEthernet2 no ip address ipv6 address FD03::1:1/124 ipv6 enable ipv6 rip EXT enable ! ipv6 router ospf 1 router-id 10.2.2.2 default-metric 25 redistribute rip EXT metric-type 1 include-connected ! ipv6 router rip EXT redistribute ospf 1 match internal external 1 external 2 include-connected ! |
外部路由器 |
---|
ipv6 unicast-routing |
使用本節內容,確認您的組態是否正常運作。
Output Interpreter工具支援某些show命令。使用OIT檢視show命令輸出的分析。
show ipv6 ospf database 命令顯示路由器的鏈路狀態資料庫(LSDB)。
附註:只有完成註冊的思科使用者能存取思科內部工具與資訊。
Stub_Router#show ipv6 ospf database OSPFv3 Router with ID (10.3.3.3) (Process ID 1) Router Link States (Area 2) ADV Router Age Seq# Fragment ID Link count Bits 10.1.1.1 5 0x8000000F 0 1 B 10.3.3.3 38 0x8000000E 0 1 None Inter Area Prefix Link States (Area 2) ADV Router Age Seq# Prefix 10.1.1.1 5 0x80000002 ::/0 Link (Type-8) Link States (Area 2) ADV Router Age Seq# Link ID Interface 10.1.1.1 5 0x8000000A 8 Gi0/0 10.3.3.3 292 0x80000005 2 Gi0/0 Intra Area Prefix Link States (Area 2) ADV Router Age Seq# Link ID Ref-lstype Ref-LSID 10.1.1.1 5 0x8000000B 0 0x2001 0 10.3.3.3 548 0x80000002 0 0x2001 0
show ipv6 ospf database router 命令會顯示路由器發出和接收的Router LSA。路由器LSA沒有地址或字首資訊。
Stub_Router#show ipv6 ospf database router OSPFv3 Router with ID (10.3.3.3) (Process ID 1) Router Link States (Area 2) Routing Bit Set on this LSA LS age: 141 Options: (V6-Bit, R-Bit, DC-Bit) LS Type: Router Links Link State ID: 0 Advertising Router: 10.1.1.1 LS Seq Number: 8000000F Checksum: 0x9C2C Length: 40 Area Border Router Number of Links: 1 Link connected to: another Router (point-to-point) Link Metric: 1 Local Interface ID: 8 Neighbor Interface ID: 2 Neighbor Router ID: 10.3.3.3 LS age: 174 Options: (V6-Bit, R-Bit, DC-Bit) LS Type: Router Links Link State ID: 0 Advertising Router: 10.3.3.3 LS Seq Number: 8000000E Checksum: 0xBBF Length: 40 Number of Links: 1 Link connected to: another Router (point-to-point) Link Metric: 1 Local Interface ID: 2 Neighbor Interface ID: 8 Neighbor Router ID: 10.1.1.1
LSA帶有具有以下位的Options欄位:
V6位 — 表示路由器/鏈路是否必須用於路由計算。
R位元 — 這是「路由器位元」。 指示發起方是否為活動路由器。
DC位 — 表示請求電路的路由器處理。
show ipv6 ospf database link self-originate 命令顯示鏈路LSA帶有鏈路特定地址。
Stub_Router#show ipv6 ospf database link self-originate OSPFv3 Router with ID (10.3.3.3) (Process ID 1) Link (Type-8) Link States (Area 2) LS age: 650 Options: (V6-Bit, R-Bit, DC-Bit) LS Type: Link-LSA (Interface: GigabitEthernet0/0) Link State ID: 2 (Interface ID) Advertising Router: 10.3.3.3 LS Seq Number: 80000005 Checksum: 0x8578 Length: 56 Router Priority: 1 Link Local Address: FE80::5054:FF:FE00:3A Number of Prefixes: 1 Prefix Address: FD01:ABAB:: Prefix Length: 64, Options: None
由於末節路由器屬於完全末節區域,因此ABR1路由器只向末節路由器傳送預設路由。
Stub_Router#show ipv6 route IPv6 Routing Table - default - 5 entries Codes: C - Connected, L - Local, S - Static, U - Per-user Static route B - BGP, HA - Home Agent, MR - Mobile Router, R - RIP H - NHRP, I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea IS - ISIS summary, D - EIGRP, EX - EIGRP external, NM - NEMO ND - ND Default, NDp - ND Prefix, DCE - Destination, NDr - Redirect RL - RPL, O - OSPF Intra, OI - OSPF Inter, OE1 - OSPF ext 1 OE2 - OSPF ext 2, ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2 la - LISP alt, lr - LISP site-registrations, ld - LISP dyn-eid lA - LISP away, a - Application OI ::/0 [110/2] via FE80::5054:FF:FE00:15, GigabitEthernet0/0 C FD01:ABAB::/64 [0/0] via GigabitEthernet0/0, directly connected L FD01:ABAB::5054:FF:FE00:3A/128 [0/0] via GigabitEthernet0/0, receive O FD02:ABAB::/64 [110/2] via FE80::5054:FF:FE00:15, GigabitEthernet0/0 L FF00::/8 [0/0] via Null0, receive
ABR1路由器是區域邊界路由器。
ABR1#show ipv6 ospf Routing Process "ospfv3 1" with ID 10.1.1.1 Supports NSSA (compatible with RFC 3101) Supports Database Exchange Summary List Optimization (RFC 5243) Event-log enabled, Maximum number of events: 1000, Mode: cyclic It is an area border router Router is not originating router-LSAs with maximum metric Initial SPF schedule delay 50 msecs Minimum hold time between two consecutive SPFs 200 msecs Maximum wait time between two consecutive SPFs 5000 msecs Initial LSA throttle delay 50 msecs Minimum hold time for LSA throttle 200 msecs Maximum wait time for LSA throttle 5000 msecs Minimum LSA arrival 100 msecs LSA group pacing timer 240 secs Interface flood pacing timer 33 msecs Retransmission pacing timer 66 msecs Retransmission limit dc 24 non-dc 24 EXCHANGE/LOADING adjacency limit: initial 300, process maximum 300 Number of external LSA 2. Checksum Sum 0x011699 Number of areas in this router is 2. 1 normal 1 stub 0 nssa Graceful restart helper support enabled Reference bandwidth unit is 100 mbps RFC1583 compatibility enabled Area BACKBONE(0) Number of interfaces in this area is 1 SPF algorithm executed 17 times Number of LSA 8. Checksum Sum 0x05579B Number of DCbitless LSA 0 Number of indication LSA 0 Number of DoNotAge LSA 0 Flood list length 0 Area 2 Number of interfaces in this area is 1 It is a stub area, no summary LSA in this area Generates stub default route with cost 1 SPF algorithm executed 20 times Number of LSA 7. Checksum Sum 0x0380EA Number of DCbitless LSA 0 Number of indication LSA 0 Number of DoNotAge LSA 0 Flood list length 0
ABR1路由器從ASBR路由器接收外部路由(RIP路由)。
ABR1#show ipv6 route IPv6 Routing Table - default - 8 entries Codes: C - Connected, L - Local, S - Static, U - Per-user Static route B - BGP, R - RIP, H - NHRP, I1 - ISIS L1 I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary, D - EIGRP EX - EIGRP external, ND - ND Default, NDp - ND Prefix, DCE - Destination NDr - Redirect, RL - RPL, O - OSPF Intra, OI - OSPF Inter OE1 - OSPF ext 1, OE2 - OSPF ext 2, ON1 - OSPF NSSA ext 1 ON2 - OSPF NSSA ext 2, la - LISP alt, lr - LISP site-registrations ld - LISP dyn-eid, lA - LISP away, le - LISP extranet-policy lp - LISP publications, a - Application, m - OMP O FD01:ABAB::/64 [110/2] via FE80::5054:FF:FE00:3A, GigabitEthernet2 C FD02:ABAB::/64 [0/0] via GigabitEthernet2, directly connected L FD02:ABAB::5054:FF:FE00:15/128 [0/0] via GigabitEthernet2, receive C FD03::/124 [0/0] via GigabitEthernet1, directly connected L FD03::1/128 [0/0] via GigabitEthernet1, receive OE1 FD03::1:0/124 [110/26] via FE80::5054:FF:FE00:3E, GigabitEthernet1 OE1 FD04:ABAB::/64 [110/26] via FE80::5054:FF:FE00:3E, GigabitEthernet1 L FF00::/8 [0/0] via Null0, receive
ASBR路由器是網路的自治系統邊界路由器。它通過Serial 0/0介面連線到RIP網路。
ASBR#show ipv6 ospf Routing Process "ospfv3 1" with ID 10.2.2.2 Supports NSSA (compatible with RFC 3101) Supports Database Exchange Summary List Optimization (RFC 5243) Event-log enabled, Maximum number of events: 1000, Mode: cyclic It is an autonomous system boundary router Redistributing External Routes (with default metric 25) from, rip EXT with metric-type 1 include-connected Router is not originating router-LSAs with maximum metric Initial SPF schedule delay 50 msecs Minimum hold time between two consecutive SPFs 200 msecs Maximum wait time between two consecutive SPFs 5000 msecs Initial LSA throttle delay 50 msecs Minimum hold time for LSA throttle 200 msecs Maximum wait time for LSA throttle 5000 msecs Minimum LSA arrival 100 msecs LSA group pacing timer 240 secs Interface flood pacing timer 33 msecs Retransmission pacing timer 66 msecs Retransmission limit dc 24 non-dc 24 EXCHANGE/LOADING adjacency limit: initial 300, process maximum 300 Number of external LSA 2. Checksum Sum 0x011699 Number of areas in this router is 1. 1 normal 0 stub 0 nssa Graceful restart helper support enabled Reference bandwidth unit is 100 mbps RFC1583 compatibility enabled Area BACKBONE(0) Number of interfaces in this area is 1 SPF algorithm executed 10 times Number of LSA 8. Checksum Sum 0x05579B Number of DCbitless LSA 0 Number of indication LSA 0 Number of DoNotAge LSA 0 Flood list length 0
ASBR#show ipv6 rip RIP process "EXT", port 521, multicast-group FF02::9, pid 678 Administrative distance is 120. Maximum paths is 16 Updates every 30 seconds, expire after 180 Holddown lasts 0 seconds, garbage collect after 120 Split horizon is on; poison reverse is off Default routes are not generated Periodic updates 267, trigger updates 11 Full Advertisement 1, Delayed Events 0 Interfaces: GigabitEthernet2 Redistribution: Redistributing protocol ospf 1 with transparent metric (internal, external 1 & 2, ) include-connected
本節內容可協助您疑難排解組態問題。
附註:使用 debug 指令之前,請先參閱有關 Debug 指令的重要資訊。
debug ipv6
一旦在末節路由器上啟用了OSPFv3,它就會向FF02::5組播地址傳送OSPFv3第1類Hello消息。收到來自ABR1路由器的Hello資料包後,它們會協商主/次關係,然後開始傳送DBD資料包。
Stub_Router#debug ipv6 ospf events Stub_Router#debug ipv6 ospf packet
Stub_Router#debug ipv6 ospf adj*Mar 8 17:47:01.324: OSPFv3-1-IPv6 PAK : Gi0/0: OUT: FE80::5054:FF:FE00:3A->FF02::5: ver:3 type:1 len:36 rid:10.3.3.3 area:0.0.0.2 chksum:A0F9 inst:0 *Mar 8 17:47:03.307: OSPFv3-1-IPv6 PAK : Gi0/0: IN: FE80::5054:FF:FE00:15->FF02::5: ver:3 type:1 len:36 rid:10.1.1.1 area:0.0.0.2 chksum:A31C inst:0 *Mar 8 17:47:03.308: OSPFv3-1-IPv6 ADJ Gi0/0: Added 10.1.1.1 to nbr list *Mar 8 17:47:03.308: OSPFv3-1-IPv6 PAK : Gi0/0: OUT: FE80::5054:FF:FE00:3A->FE80::5054:FF:FE00:15: ver:3 type:1 len:40 rid:10.3.3.3 area:0.0.0.2 chksum:470D inst:0 *Mar 8 17:47:03.320: OSPFv3-1-IPv6 PAK : Gi0/0: IN: FE80::5054:FF:FE00:15->FE80::5054:FF:FE00:3A: ver:3 type:1 len:40 rid:10.1.1.1 area:0.0.0.2 chksum:4707 inst:0 *Mar 8 17:47:03.321: OSPFv3-1-IPv6 ADJ Gi0/0: 2 Way Communication to 10.1.1.1, state 2WAY *Mar 8 17:47:03.321: OSPFv3-1-IPv6 ADJ Gi0/0: Nbr 10.1.1.1: Prepare dbase exchange *Mar 8 17:47:03.322: OSPFv3-1-IPv6 ADJ Gi0/0: Send DBD to 10.1.1.1 seq 0x983C9C0 opt 0x11 flag 0x7 len 28 *Mar 8 17:47:03.322: OSPFv3-1-IPv6 PAK : Gi0/0: OUT: FE80::5054:FF:FE00:3A->FE80::5054:FF:FE00:15: ver:3 type:2 len:28 rid:10.3.3.3 area:0.0.0.2 chksum:7A33 inst:0 *Mar 8 17:47:03.328: OSPFv3-1-IPv6 PAK : Gi0/0: IN: FE80::5054:FF:FE00:15->FE80::5054:FF:FE00:3A: ver:3 type:2 len:148 rid:10.1.1.1 area:0.0.0.2 chksum:141A inst:0 *Mar 8 17:47:03.329: OSPFv3-1-IPv6 ADJ Gi0/0: Rcv DBD from 10.1.1.1 seq 0x983C9C0 opt 0x11 flag 0x2 len 148 mtu 1500 state EXSTART *Mar 8 17:47:03.330: OSPFv3-1-IPv6 ADJ Gi0/0: NBR Negotiation Done. We are the MASTER *Mar 8 17:47:03.330: OSPFv3-1-IPv6 ADJ Gi0/0: Nbr 10.1.1.1: Summary list built, size 7 *Mar 8 17:47:03.331: OSPFv3-1-IPv6 ADJ Gi0/0: Send DBD to 10.1.1.1 seq 0x983C9C1 opt 0x11 flag 0x1 len 128 *Mar 8 17:47:03.331: OSPFv3-1-IPv6 PAK : Gi0/0: OUT: FE80::5054:FF:FE00:3A->FE80::5054:FF:FE00:15: ver:3 type:2 len:128 rid:10.3.3.3 area:0.0.0.2 chksum:F771 inst:0 *Mar 8 17:47:03.334: OSPFv3-1-IPv6 PAK : Gi0/0: IN: FE80::5054:FF:FE00:15->FE80::5054:FF:FE00:3A: ver:3 type:3 len:64 rid:10.1.1.1 area:0.0.0.2 chksum:C6FA inst:0 *Mar 8 17:47:03.335: OSPFv3-1-IPv6 PAK : Gi0/0: IN: FE80::5054:FF:FE00:15->FE80::5054:FF:FE00:3A: ver:3 type:2 len:28 rid:10.1.1.1 area:0.0.0.2 chksum:7C3D inst:0
交換DBD資料包後,路由器會傳送鏈路狀態請求(LS REQ)和鏈路狀態更新(LS UPD)消息以構建其LSDB。在連續的LS REQ和LS UPD消息之後,當狀態達到FULL時,路由器繼續交換Hello資料包。
Stub_Router#*Mar 8 17:47:03.337: OSPFv3-1-IPv6 ADJ Gi0/0: Rcv LS REQ from 10.1.1.1 length 64 LSA count 4 *Mar 8 17:47:03.337: OSPFv3-1-IPv6 ADJ Gi0/0: Send LS UPD to FE80::5054:FF:FE00:15 length 172 LSA count 4 *Mar 8 17:47:03.338: OSPFv3-1-IPv6 PAK : Gi0/0: OUT: FE80::5054:FF:FE00:3A->FE80::5054:FF:FE00:15: ver:3 type:4 len:172 rid:10.3.3.3 area:0.0.0.2 chksum:D2CE inst:0 *Mar 8 17:47:03.339: OSPFv3-1-IPv6 ADJ Gi0/0: Rcv DBD from 10.1.1.1 seq 0x983C9C1 opt 0x11 flag 0x0 len 28 mtu 1500 state EXCHANGE *Mar 8 17:47:03.339: OSPFv3-1-IPv6 ADJ Gi0/0: Exchange Done with 10.1.1.1
*Mar 8 17:47:03.340: OSPFv3-1-IPv6 ADJ Gi0/0: Send LS REQ to 10.1.1.1 length 40 *Mar 8 17:47:03.340: OSPFv3-1-IPv6 PAK : Gi0/0: OUT: FE80::5054:FF:FE00:3A->FE80::5054:FF:FE00:15: ver:3 type:3 len:40 rid:10.3.3.3 area:0.0.0.2 chksum:FD46 inst:0 *Mar 8 17:47:03.343: OSPFv3-1-IPv6 PAK : Gi0/0: IN: FE80::5054:FF:FE00:15->FE80::5054:FF:FE00:3A: ver:3 type:4 len:72 rid:10.1.1.1 area:0.0.0.2 chksum:825E inst:0 *Mar 8 17:47:03.345: OSPFv3-1-IPv6 ADJ Gi0/0: Rcv LS UPD from Nbr ID 10.1.1.1 length 72 LSA count 2 *Mar 8 17:47:03.345: OSPFv3-1-IPv6 ADJ Gi0/0: Synchronized with 10.1.1.1, state FULL *Mar 8 17:47:03.346: %OSPFv3-5-ADJCHG: Process 1, Nbr 10.1.1.1 on GigabitEthernet0/0 from LOADING to FULL, Loading Done
修訂 | 發佈日期 | 意見 |
---|---|---|
3.0 |
09-Mar-2023 |
已替換所有輸出代碼。重新認證。 |
1.0 |
10-Aug-2010 |
初始版本 |