IP : IP 版本 6 (IPv6)

过滤使用“前缀列表”配置示例的IPv6流量

2016 年 10 月 27 日 - 机器翻译
其他版本: PDFpdf | 英语 (2015 年 8 月 22 日) | 反馈


目录


简介

本文为IPv6前缀列表提供一配置示例。在示例中,路由器R1和R2配置与IPv6编址方案并且通过串行链路连接。在两路由器启用的路由协议是IPv6 OSPF。为了生成网络, 10环回地址在路由器R2配置,并且在两路由器配置的环回地址(R1和R2)用IPv6 OSPF进程ID区域area-id [instance instance-id]命令彼此通告。在本例中,起源于路由器R2环回8和环回9接口到达路由器R1的它要求拒绝显式路由。

此配置示例使用IPv6前缀列表列表名称命令为了建立名为在路由器R1的ipv6_all_addresses的IPv6前缀列表。

在这种情况下,在IPv6 OSPF,请使用distribute-list前缀列表列表名称命令为了运用在配置的协议的前缀列表。

先决条件

要求

尝试进行此配置之前,请确保满足以下要求:

使用的组件

本文档中的信息根据在Cisco IOS�软件版本15.1的Cisco 7200系列路由器(在路由器R1和R2)的配置。

规则

有关文档规则的信息,请参阅 Cisco 技术提示规则

配置

本部分提供有关如何配置本文档所述功能的信息。

注意: 使用命令查找工具仅限注册用户)查找有关本文档所使用命令的详细信息。

网络图

本文档使用以下网络设置:

http://www.cisco.com/c/dam/en/us/support/docs/ip/ip-version-6-ipv6/113489-ipv6-pfl-new-01.gif

配置

本文档使用以下配置:

路由器 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

注意: 前缀列表有这些命名限制:

  • 不可以是名称和现有的访问列表一样。

  • 因为他们是在显示IPv6前缀列表命令的关键字不可以是命名“详细信息”或“摘要”。

路由器 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,请使用ospf命令的show ipv6 route

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前缀列表或前缀列表条目的信息,请使用detail命令显示IPv6的前缀列表

显示IPv6前缀列表
在路由器 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 命令输出的分析。

故障排除

目前没有针对此配置的故障排除信息。


相关信息


Document ID: 113489