拓樸 2014 思科和 / 或其附屬公司 保留所有權利 本檔案所含內容為思科公開發佈的資訊 第 1 頁, 共 10 頁
位址分配表 裝置介面 IPv6 位址預設閘道 R1 G0/0 S0/0/0 (DCE) S0/0/1 R2 G0/0 S0/0/0 S0/0/1 (DCE) R3 G0/0 S0/0/0 (DCE) S0/0/1 2001:DB8:ACAD:A::1/64 FE80::1 link-local 2001:DB8:ACAD:12::1/64 FE80::1 link-local 2001:DB8:ACAD:13::1/64 FE80::1 link-local 2001:DB8:ACAD:B::2/64 FE80::2 link-local 2001:DB8:ACAD:12::2/64 FE80::2 link-local 2001:DB8:ACAD:23::2/64 FE80::2 link-local 2001:DB8:ACAD:C::3/64 FE80::3 link-local 2001:DB8:ACAD:13::3/64 FE80::3 link-local 2001:DB8:ACAD:23::3/64 FE80::3 link-local PC-A NIC 2001:DB8:ACAD:A::A/64 FE80::1 PC-B NIC 2001:DB8:ACAD:B::B/64 FE80::2 PC-C NIC 2001:DB8:ACAD:C::C/64 FE80::3 目標 第 1 部分 : 建立網路並設定裝置的基本設定 第 2 部分 : 設定並檢驗 OSPFv3 路由 第 3 部分 : 設定 OSPFv3 被動介面 背景 / 場景 開放最短路徑優先 (OSPF) 是用於 IP 網路的鏈路狀態路由協定 OSPFv2 適用於 IPv4 網路, 而 OSPFv3 適用於 IPv6 網路 在本實驗中, 你將使用 OSPFv3 路由設定網路拓樸, 分配路由器 ID, 設定被動介面, 並使用大量的 CLI 命令顯示和檢驗 OSPFv3 路由資訊 2014 思科和 / 或其附屬公司 保留所有權利 本檔案所含內容為思科公開發佈的資訊 第 2 頁, 共 10 頁
注意 :CCNA 動手實驗所用的路由器是採用 Cisco IOS Release 15.2(4)M3(universalk9 映像檔 ) 的 Cisco 1941 整合服務路由器 (ISR) 也可使用其他路由器以及 Cisco IOS 版本 根據型號以及 Cisco IOS 版本不同, 可用命令和產生的輸出可能與實驗顯示的不一樣 請參考本實驗末尾的 路由器介面摘要表 以瞭解正確的介面識別字 注意 : 請確保已經清除路由器的啟動設定 如果不確定, 請聯繫教師 所需資源 3 台路由器 ( 支援 Cisco IOS 15.2(4)M3 版通用映像檔的 Cisco 1941 或同類路由器 ) 3 台 PC( 採用 Windows 7 Vista 或 XP 且支援終端模擬程序, 比如 Tera Term) 主控台纜線, 用於透過主控台連接埠配置 Cisco IOS 設備 如拓樸所示的乙太網路纜線和序列纜線 第 1 部分 : 建立網路並設定裝置的基本設定 在第 1 部分, 你需要建立網路拓樸並設定 PC 主機和路由器的基本設定 第 1 步 : 建立如拓樸圖所示的網路 第 2 步 : 根據需要初始化並重新載入路由器 第 3 步 : 設定每個路由器的基本設定 a. 停用 DNS 查詢 b. 如拓樸所示設定裝置名稱 c. 指定 class 為特權 EXEC 密碼 d. 指定 cisco 作為 vty 密碼 e. 設定一個向使用者發出警告的 MOTD 標語 :Unauthorized access is prohibited f. 為主控台線路設定 logging synchronous g. 加密純文字密碼 h. 在所有介面上設定位址分配表中列出的 IPv6 單點傳送位址和鏈路本地位址 i. 在每台路由器上設定 IPv6 單點傳送路由 j. 將執行設定複製到啟動設定 第 4 步 : 設定 PC 主機 第 5 步 : 測試連通性 路由器應該能夠相互執行 ping 操作, 並且每台 PC 都應該能對其預設閘道執行 ping 操作 如果不設定 OSPFv3 路由,PC 就無法對其他 PC 執行 ping 操作 如果需要, 請檢驗並排除故障 第 2 部分 : 設定 OSPFv3 路由 在第 2 部分, 你將為網路中的所有路由器設定 OSPFv3 路由, 然後檢驗路由表是否正確更新 2014 思科和 / 或其附屬公司 保留所有權利 本檔案所含內容為思科公開發佈的資訊 第 3 頁, 共 10 頁
第 1 步 : 分配路由器 ID OSPFv3 繼續為路由器 ID 使用 32 位元位址 由於未在路由器上設定 IPv4 位址, 你需要使用 router-id 命令手動分配路由器 ID a. 發出 ipv6 router ospf 命令, 開始路由器的 OSPFv3 流程 R1(config)# ipv6 router ospf 1 注意 :OSPF 程序 ID 具有本地意義, 對網路中的其他路由器沒有任何意義 b. 為 R1 分配 OSPFv3 路由器 ID 1.1.1.1 R1(config-rtr)# router-id 1.1.1.1 c. 開始 OSPFv3 路由程序, 並為 R2 分配路由器 ID 2.2.2.2, 為 R3 分配路由器 ID 3.3.3.3 d. 發出 show ipv6 ospf 命令, 檢驗所有路由器上的路由器 ID R2# show ipv6 ospf Routing Process "ospfv3 1" with ID 2.2.2.2 Event-log enabled, Maximum number of events: 1000, Mode: cyclic Router is not originating router-lsas with maximum metric < 省略部分輸出 > 第 2 步 : 在 R1 上設定 OSPFv6 在 IPv6 中, 一個介面設定多個 IPv6 位址很常見 OSPFv3 中取消了 network 敘述 相反,OSPFv3 路由在介面上啟用 a. 對 R1 上參與 OSPFv3 路由的每個介面發出 ipv6 ospf 1 area 0 命令 R1(config)# interface g0/0 R1(config-if)# ipv6 ospf 1 area 0 R1(config-if)# interface s0/0/0 R1(config-if)# ipv6 ospf 1 area 0 R1(config-if)# interface s0/0/1 R1(config-if)# ipv6 ospf 1 area 0 注意 : 程序 ID 必須與你在第 1a 步中使用的程序 ID 匹配 b. 將 R2 和 R3 的介面分配到 OSPFv3 區域 0 當向區域 0 增加介面時, 你將看到鄰居鄰接訊息 R1# *Mar 19 22:14:43.251: %OSPFv3-5-ADJCHG: Process 1, Nbr 2.2.2.2 on Serial0/0/0 from LOADING to FULL, Loading Done R1# *Mar 19 22:14:46.763: %OSPFv3-5-ADJCHG: Process 1, Nbr 3.3.3.3 on Serial0/0/1 from LOADING to FULL, Loading Done 第 3 步 : 檢驗 OSPFv3 鄰居 發出 show ipv6 ospf neighbor 命令, 檢驗該路由器是否已與其相鄰路由器建立鄰接關係 如果未顯示相鄰路由器的路由器 ID, 或未顯示 FULL 狀態, 則表明兩台路由器未建立 OSPF 鄰接關係 R1# show ipv6 ospf neighbor OSPFv3 Router with ID (1.1.1.1) (Process ID 1) 2014 思科和 / 或其附屬公司 保留所有權利 本檔案所含內容為思科公開發佈的資訊 第 4 頁, 共 10 頁
Neighbor ID Pri State Dead Time Interface ID Interface 3.3.3.3 0 FULL/ - 00:00:39 6 Serial0/0/1 2.2.2.2 0 FULL/ - 00:00:36 6 Serial0/0/0 第 4 步 : 檢驗 OSPFv3 協定設定 使用 show ipv6 protocols 命令可以快速檢驗重要的 OSPFv3 設定資訊, 其中包括 OSPF 程序 ID 路由器 ID 和啟用 OSPFv3 的介面 R1# show ipv6 protocols IPv6 Routing Protocol is "connected" IPv6 Routing Protocol is "ND" IPv6 Routing Protocol is "ospf 1" Router ID 1.1.1.1 Number of areas: 1 normal, 0 stub, 0 nssa Interfaces (Area 0): Serial0/0/1 Serial0/0/0 GigabitEthernet0/0 Redistribution: None 第 5 步 : 檢驗 OSPFv3 介面 a. 發出 show ipv6 ospf interface 命令可以顯示每個啟用了 OSPF 的介面的詳細清單 R1# show ipv6 ospf interface Serial0/0/1 is up, line protocol is up Link Local Address FE80::1, Interface ID 7 Area 0, Process ID 1, Instance ID 0, Router ID 1.1.1.1 Network Type POINT_TO_POINT, Cost: 64 Transmit Delay is 1 sec, State POINT_TO_POINT Hello due in 00:00:05 Index 1/3/3, flood queue length 0 Last flood scan length is 1, maximum is 1 Neighbor Count is 1, Adjacent neighbor count is 1 Adjacent with neighbor 3.3.3.3 Serial0/0/0 is up, line protocol is up Link Local Address FE80::1, Interface ID 6 Area 0, Process ID 1, Instance ID 0, Router ID 1.1.1.1 Network Type POINT_TO_POINT, Cost: 64 Transmit Delay is 1 sec, State POINT_TO_POINT Hello due in 00:00:00 2014 思科和 / 或其附屬公司 保留所有權利 本檔案所含內容為思科公開發佈的資訊 第 5 頁, 共 10 頁
Index 1/2/2, flood queue length 0 Last flood scan length is 1, maximum is 2 Neighbor Count is 1, Adjacent neighbor count is 1 Adjacent with neighbor 2.2.2.2 GigabitEthernet0/0 is up, line protocol is up Link Local Address FE80::1, Interface ID 3 Area 0, Process ID 1, Instance ID 0, Router ID 1.1.1.1 Network Type BROADCAST, Cost: 1 Transmit Delay is 1 sec, State DR, Priority 1 Designated Router (ID) 1.1.1.1, local address FE80::1 No backup designated router on this network Hello due in 00:00:03 Index 1/1/1, flood queue length 0 Last flood scan length is 0, maximum is 0 Neighbor Count is 0, Adjacent neighbor count is 0 b. 要顯示啟用了 OSPFv3 的介面的摘要資訊, 則發出 show ipv6 ospf interface brief 命令 R1# show ipv6 ospf interface brief Interface PID Area Intf ID Cost State Nbrs F/C Se0/0/1 1 0 7 64 P2P 1/1 Se0/0/0 1 0 6 64 P2P 1/1 Gi0/0 1 0 3 1 DR 0/0 第 6 步 : 檢驗 IPv6 路由表 發出 show ipv6 route 命令, 以檢驗所有網路是否都顯示在路由表中 R2# show ipv6 route IPv6 Routing Table - default - 10 entries Codes: C - Connected, L - Local, S - Static, U - Per-user Static route B - BGP, R - RIP, 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 O - OSPF Intra, OI - OSPF Inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2 ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2 O 2001:DB8:ACAD:A::/64 [110/65] via FE80::1, Serial0/0/0 C 2001:DB8:ACAD:B::/64 [0/0] via GigabitEthernet0/0, directly connected L 2001:DB8:ACAD:B::2/128 [0/0] via GigabitEthernet0/0, receive O 2001:DB8:ACAD:C::/64 [110/65] 2014 思科和 / 或其附屬公司 保留所有權利 本檔案所含內容為思科公開發佈的資訊 第 6 頁, 共 10 頁
via FE80::3, Serial0/0/1 C 2001:DB8:ACAD:12::/64 [0/0] via Serial0/0/0, directly connected L 2001:DB8:ACAD:12::2/128 [0/0] via Serial0/0/0, receive O 2001:DB8:ACAD:13::/64 [110/128] via FE80::3, Serial0/0/1 via FE80::1, Serial0/0/0 C 2001:DB8:ACAD:23::/64 [0/0] via Serial0/0/1, directly connected L 2001:DB8:ACAD:23::2/128 [0/0] via Serial0/0/1, receive L FF00::/8 [0/0] via Null0, receive 使用什麼命令可以只查看路由表中的 OSPF 路由? 第 7 步 : 檢驗端對端連通性 每台 PC 都應能夠對拓樸中的其他 PC 執行 ping 操作 如果需要, 請檢驗並排除故障 注意 :PC 之間執行 ping 操作可能需要停用 PC 防火牆 第 3 部分 : 設定 OSPFv3 被動介面 passive-interface 命令用於防止路由更新透過指定路由器連接埠發送 因為它們不需要接收動態路由協定通訊, 這樣做通常是為了減少 LAN 的流量 在第 3 部分, 你將使用 passive-interface 命令將單個介面設定為被動介面 你還將設定 OSPFv3, 以便路由器的所有介面在預設情況下是被動介面, 然後啟用選定介面的 OSPF 路由通告 第 1 步 : 設定被動介面 a. 在 R1 上發出 show ipv6 ospf interface g0/0 命令 請注意計時器指示下一個 hello 封包的預期時間 Hello 封包每 10 秒發送一次, 用於在 OSPF 路由器之間檢驗其鄰居是否已啟用 R1# show ipv6 ospf interface g0/0 GigabitEthernet0/0 is up, line protocol is up Link Local Address FE80::1, Interface ID 3 Area 0, Process ID 1, Instance ID 0, Router ID 1.1.1.1 Network Type BROADCAST, Cost: 1 Transmit Delay is 1 sec, State DR, Priority 1 Designated Router (ID) 1.1.1.1, local address FE80::1 No backup designated router on this network Hello due in 00:00:05 Index 1/1/1, flood queue length 0 Last flood scan length is 0, maximum is 0 2014 思科和 / 或其附屬公司 保留所有權利 本檔案所含內容為思科公開發佈的資訊 第 7 頁, 共 10 頁
Neighbor Count is 0, Adjacent neighbor count is 0 b. 發出 passive-interface 命令可將 R1 上的介面 G0/0 該為被動 R1(config)# ipv6 router ospf 1 R1(config-rtr)# passive-interface g0/0 c. 再次發出 show ipv6 ospf interface g0/0 命令, 以檢驗 G0/0 目前是否為被動 R1# show ipv6 ospf interface g0/0 GigabitEthernet0/0 is up, line protocol is up Link Local Address FE80::1, Interface ID 3 Area 0, Process ID 1, Instance ID 0, Router ID 1.1.1.1 Network Type BROADCAST, Cost: 1 Transmit Delay is 1 sec, State WAITING, Priority 1 No designated router on this network No backup designated router on this network No Hellos (Passive interface) Wait time before Designated router selection 00:00:34 Index 1/1/1, flood queue length 0 Last flood scan length is 0, maximum is 0 Neighbor Count is 0, Adjacent neighbor count is 0 d. 在 R2 和 R3 上發出 show ipv6 route ospf 命令, 以檢驗到 2001:DB8:ACAD:A::/64 網路的路由是否仍然可用 R2# show ipv6 route ospf IPv6 Routing Table - default - 10 entries Codes: C - Connected, L - Local, S - Static, U - Per-user Static route B - BGP, R - RIP, 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 O - OSPF Intra, OI - OSPF Inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2 ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2 O 2001:DB8:ACAD:A::/64 [110/65] via FE80::1, Serial0/0/0 O 2001:DB8:ACAD:C::/64 [110/65] via FE80::3, Serial0/0/1 O 2001:DB8:ACAD:13::/64 [110/128] via FE80::3, Serial0/0/1 via FE80::1, Serial0/0/0 第 2 步 : 將被動介面設定為路由器的預設設定 a. 在 R2 上發出 passive-interface default 命令, 以將所有 OSPFv3 介面的預設設定設為被動 R2(config)# ipv6 router ospf 1 R2(config-rtr)# passive-interface default 2014 思科和 / 或其附屬公司 保留所有權利 本檔案所含內容為思科公開發佈的資訊 第 8 頁, 共 10 頁
b. 在 R1 上發出 show ipv6 ospf neighbor 命令 在 dead 計時器超時後,R2 不再列為 OSPF 鄰居 R1# show ipv6 ospf neighbor OSPFv3 Router with ID (1.1.1.1) (Process ID 1) Neighbor ID Pri State Dead Time Interface ID Interface 3.3.3.3 0 FULL/ - 00:00:37 6 Serial0/0/1 c. 在 R2 上發出 show ipv6 ospf interface s0/0/0 命令, 以查看介面 S0/0/0 的 OSPF 狀態 R2# show ipv6 ospf interface s0/0/0 Serial0/0/0 is up, line protocol is up Link Local Address FE80::2, Interface ID 6 Area 0, Process ID 1, Instance ID 0, Router ID 2.2.2.2 Network Type POINT_TO_POINT, Cost: 64 Transmit Delay is 1 sec, State POINT_TO_POINT No Hellos (Passive interface) Index 1/2/2, flood queue length 0 Last flood scan length is 2, maximum is 3 Neighbor Count is 0, Adjacent neighbor count is 0 d. 如果 R2 上的所有 OSPFv3 介面都是被動介面, 則不通告任何路由資訊 在這種情況下,R1 和 R3 不再存在通往 2001:DB8:ACAD:B::/64 網路的路由 使用 show ipv6 route 命令可以檢驗這一點 e. 發出 no passive-interface 命令更改 R2 的 S0/0/1, 以便 R2 發送和接收 OSPFv3 路由更新 輸入該命令後, 將顯示一條資訊性訊息, 指示已與 R3 建立鄰接關係 R2(config)# ipv6 router ospf 1 R2(config-rtr)# no passive-interface s0/0/1 *Apr 8 19:21:57.939: %OSPFv3-5-ADJCHG: Process 1, Nbr 3.3.3.3 on Serial0/0/1 from LOADING to FULL, Loading Done f. 在 R1 和 R3 上再次發出 show ipv6 route 和 show ipv6 ospf neighbor 命令, 並查詢通往 2001:DB8:ACAD:B::/64 網路的路由 R1 使用那個介面路由到 2001:DB8:ACAD:B::/64 網路? R1 上 2001:DB8:ACAD:B::/64 網路的累計成本度量是多少? R2 是否顯示為 R1 的 OSPFv3 鄰居? R2 是否顯示為 R3 的 OSPFv3 鄰居? 此資訊說明什麼? 2014 思科和 / 或其附屬公司 保留所有權利 本檔案所含內容為思科公開發佈的資訊 第 9 頁, 共 10 頁
思考 g. 在 R2 上, 發出 no passive-interface S0/0/0 命令將允許該介面上通告 OSPFv3 路由更新 h. 檢驗 R1 和 R2 現已成為 OSPFv3 鄰居 1. 如果 R1 的 OSPFv6 設定使用程序 ID 1, 而 R2 的 OSPFv3 設定使用程序 ID 2, 那麼這兩個路由器之間能否交換路由資訊? 為什麼? 2. OSPFv3 中取消 network 命令的原因可能是什麼? 路由器介面摘要表 路由器介面摘要 路由器型號 Ethernet Interface #1 Ethernet Interface #2 Serial Interface #1 Serial Interface #2 1800 Fast Ethernet 0/0 (F0/0) 1900 Gigabit Ethernet 0/0 (G0/0) 2801 Fast Ethernet 0/0 (F0/0) 2811 Fast Ethernet 0/0 (F0/0) 2900 Gigabit Ethernet 0/0 (G0/0) Fast Ethernet 0/1 (F0/1) Gigabit Ethernet 0/1 (G0/1) Fast Ethernet 0/1 (F0/1) Fast Ethernet 0/1 (F0/1) Gigabit Ethernet 0/1 (G0/1) Serial 0/0/0 (S0/0/0) Serial 0/0/0 (S0/0/0) Serial 0/1/0 (S0/1/0) Serial 0/0/0 (S0/0/0) Serial 0/0/0 (S0/0/0) Serial 0/0/1 (S0/0/1) Serial 0/0/1 (S0/0/1) Serial 0/1/1 (S0/1/1) Serial 0/0/1 (S0/0/1) Serial 0/0/1 (S0/0/1) 注意 : 若要瞭解如何設定路由器, 請查看介面來確定路由器類型以及路由器擁有的介面數量 我們無法為每類路由器列出所有的設定組合 下表列出了裝置中乙太網路和序列介面組合的識別字 此表中未包含任何其他類型的介面, 但實際的路由器可能會含有其他介面 例如 ISDN BRI 介面 括弧中的字串是約定縮寫, 可在 Cisco IOS 命令中用來代表介面 2014 思科和 / 或其附屬公司 保留所有權利 本檔案所含內容為思科公開發佈的資訊 第 10 頁, 共 10 頁