本文檔提供了IPv6字首清單的配置示例。在示例中,路由器R1和R2配置了IPv6編址方案並通過串列鏈路連線。兩台路由器上啟用的路由協定是IPv6 OSPF。為了生成網路,在路由器R2中配置了10個環回地址,並使用ipv6 ospf process-id area area-id [instance-id] 命令相互通告路由器(R1和R2)上配置的環回地址。在本例中,需要拒絕來自路由器R2的環回8和環回9介面到達路由器R1的顯式路由。
此配置示例使用ipv6 prefix-list list-name 命令在路由器R1上建立名為ipv6_all_addresses的IPv6字首清單。
在此例項中,在IPv6 OSPF上,使用distribute-list prefix-listlist-name 命令將字首清單應用於配置的協定。
嘗試此組態之前,請確保符合以下要求:
IPv6編址方案知識
本文檔中的資訊基於Cisco IOS®軟體版本15.1上的Cisco 7200系列路由器(用於路由器R1和R2上的配置)。
如需檔案慣例的相關資訊,請參閱思科技術提示慣例。
本節提供用於設定本文件中所述功能的資訊。
註:使用Command Lookup Tool(僅限註冊客戶)可以查詢有關本文檔中使用的命令的詳細資訊。
本檔案會使用以下網路設定:
本檔案會使用以下設定:
路由器R1 |
---|
R1#show running-config version 15.0 ! hostname R1 ! ip cef ! ! ipv6 unicast-routing !-- Enables the forwarding of IPv6 packets. ! interface Loopback0 no ip address ipv6 address 1111::1/128 ipv6 ospf 10 area 0 !--- Enables OSPFv3 on the interface and associates !--- the interface looback1 to area 0. ! interface Loopback1 no ip address ipv6 address 2222::1/128 ipv6 ospf 10 area 0 ! interface Serial0/0 no ip address ipv6 address 1010:1:1:1::11/64 ipv6 ospf 10 area 0 clock rate 2000000 ! ! ipv6 router ospf 10 router-id 2.2.2.2 log-adjacency-changes distribute-list prefix-list ipv6_all_addresses in Applies the prefix list ipv6_all_addresses !--- to OSPF for IPv6 routing updates that are received on an interface. !--- Use this command in router configuration mode. ! ipv6 prefix-list ipv6_all_addresses seq 10 permit AB00::1/128 !--- Creates a prefix-list named ipv6_all_addresses. !--- Seq 10 denotes the sequence number of the !--- prefix list entry being configured. !--- permit/deny permits/denies the network !--- that matches the condition. ipv6 prefix-list ipv6_all_addresses seq 20 permit AB10::1/128 ipv6 prefix-list ipv6_all_addresses seq 30 permit AB20::1/128 ipv6 prefix-list ipv6_all_addresses seq 40 permit AB30::1/128 ipv6 prefix-list ipv6_all_addresses seq 50 permit AB40::1/128 ipv6 prefix-list ipv6_all_addresses seq 60 permit AB50::1/128 ipv6 prefix-list ipv6_all_addresses seq 70 permit AB60::1/128 ipv6 prefix-list ipv6_all_addresses seq 80 permit AB70::1/128 ipv6 prefix-list ipv6_all_addresses seq 90 deny AB80::1/128 ipv6 prefix-list ipv6_all_addresses seq 100 deny AB90::1/128 !--- Denies the routes AB80::1/128 & AB90::1/128. ! end |
注意:字首清單具有以下命名限制:
不能與現有訪問清單同名。
不能是名稱「detail」或「summary」,因為它們是show ipv6 prefix-list命令中的關鍵字。
路由器R2 |
---|
R2#show running-config version 15.0 ! hostname R2 ! ip cef ! ipv6 unicast-routing ! interface Loopback0 no ip address ipv6 address AB00::1/128 ipv6 ospf 10 area 0 ! interface Loopback1 no ip address ipv6 address AB10::1/128 ipv6 ospf 10 area 0 ! interface Loopback2 no ip address ipv6 address AB20::1/128 ipv6 ospf 10 area 0 ! interface Loopback3 no ip address ipv6 address AB30::1/128 ipv6 ospf 10 area 0 ! interface Loopback4 no ip address ipv6 address AB40::1/128 ipv6 ospf 10 area 0 ! interface Loopback5 no ip address ipv6 address AB50::1/128 ipv6 ospf 10 area 0 ! interface Loopback6 no ip address ipv6 address AB60::1/128 ipv6 ospf 10 area 0 ! interface Loopback7 no ip address ipv6 address AB70::1/128 ipv6 ospf 10 area 0 ! interface Loopback8 no ip address ipv6 address AB80::1/128 ipv6 ospf 10 area 0 ! interface Loopback9 no ip address ipv6 address AB90::1/128 ipv6 ospf 10 area 0 ! interface Serial0/0 no ip address ipv6 address 1010:1:1:1::10/64 ipv6 ospf 10 area 0 clock rate 2000000 ! ip forward-protocol nd ! ! ipv6 router ospf 10 router-id 1.1.1.1 log-adjacency-changes ! end |
若要驗證路由器R1收到的路由,請使用show ipv6 route ospf 命令。
show ipv6 route ospf |
---|
在路由器R1中 R1#show ipv6 route ospf IPv6 Routing Table - 13 entries Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP U - Per-user Static route, M - MIPv6 I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2 ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2 D - EIGRP, EX - EIGRP external O AB00::1/128 [110/64] via FE80::C007:EFF:FE58:0, Serial0/0 OI AB10::1/128 [110/64] via FE80::C007:EFF:FE58:0, Serial0/0 OI AB20::1/128 [110/64] via FE80::C007:EFF:FE58:0, Serial0/0 OI AB30::1/128 [110/64] via FE80::C007:EFF:FE58:0, Serial0/0 OI AB40::1/128 [110/64] via FE80::C007:EFF:FE58:0, Serial0/0 OI AB50::1/128 [110/64] via FE80::C007:EFF:FE58:0, Serial0/0 OI AB60::1/128 [110/64] via FE80::C007:EFF:FE58:0, Serial0/0 OI AB70::1/128 [110/64] via FE80::C007:EFF:FE58:0, Serial0/0 !--- Note that the routes AB80::1/128 and AB90::1/128 !--- originated from lo 8 and lo 9 are not listed here. |
為了顯示有關IPv6字首清單或字首清單項的資訊,請使用show ipv6 prefix-list detail 命令。
show ipv6 prefix-list |
---|
在路由器R1中 R1#show ipv6 prefix-list detail Prefix-list with the last deletion/insertion: ipv6_all_addresses ipv6 prefix-list ipv6_all_addresses: count: 10, range entries: 0, sequences: 10 - 100, refcount: 3 seq 10 permit AB00::1/128 (hit count: 1, refcount: 5) seq 20 permit AB10::1/128 (hit count: 1, refcount: 1) seq 30 permit AB20::1/128 (hit count: 1, refcount: 2) seq 40 permit AB30::1/128 (hit count: 1, refcount: 1) seq 50 permit AB40::1/128 (hit count: 1, refcount: 3) seq 60 permit AB50::1/128 (hit count: 1, refcount: 1) seq 70 permit AB60::1/128 (hit count: 1, refcount: 2) seq 80 permit AB70::1/128 (hit count: 1, refcount: 1) seq 90 deny AB80::1/128 (hit count: 1, refcount: 2) seq 100 deny AB90::1/128 (hit count: 1, refcount: 1) R1#show ipv6 prefix-list summary Prefix-list with the last deletion/insertion: ipv6_all_addresses ipv6 prefix-list ipv6_all_addresses: count: 10, range entries: 0, sequences: 10 - 100, refcount: 3 !--- This command displays detailed or !--- summarized information about all IPv6 prefix lists. |
輸出直譯器工具(僅供已註冊客戶使用)(OIT)支援某些show命令。使用OIT檢視show命令輸出的分析。
目前尚無適用於此組態的具體疑難排解資訊。
修訂 | 發佈日期 | 意見 |
---|---|---|
1.0 |
10-Sep-2018 |
初始版本 |