Guest

IP Version 6 (IPv6)

IPv6 Traffic Filtering Using "prefix-list" Configuration Example

Cisco - IPv6 Traffic Filtering Using "prefix-list" Configuration Example

Document ID: 113489

Updated: Mar 29, 2012

   Print

Introduction

This document provides a sample configuration for IPv6 prefix lists. In the example, routers R1 and R2 are configured with the IPv6 addressing scheme and connected through a serial link. The routing protocol enabled on the two routers is IPv6 OSPF. In order to generate networks, 10 loopback addresses are configured in router R2 and the loopback addresses configured on both the routers (R1 and R2) are advertised to each other with the ipv6 ospf process-id area area-id [instance instance-id] command. In this example, it is required to deny the explicit routes that originates from the loopback 8 and loopback 9 interfaces of router R2 that reach router R1.

This configuration example uses the ipv6 prefix-list list-name command in order to create an IPv6 prefix-list named ipv6_all_addresses on router R1.

In this instance, on IPv6 OSPF, use the distribute-list prefix-listlist-name command in order to apply the prefix list on the protocol configured.

Prerequisites

Requirements

Ensure that you meet these requirements before you attempt this configuration:

Components Used

The information in this document is based on the Cisco 7200 Series Router on Cisco IOS® Software release 15.1 (for configurations on routers R1 and R2).

Conventions

Refer to Cisco Technical Tips Conventions for information on document conventions.

Configure

In this section, you are presented with the information to configure the features described in this document.

Note: Use the Command Lookup Tool (registered customers only) in order to find more information on the commands used in this document.

Network Diagram

This document uses this network setup:

ipv6-pfl-new-01.gif

Configurations

This document uses these configurations:

Router 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

Note: The prefix-list has these naming restrictions:

  • Cannot be the same name as an existing access list.

  • Cannot be the name "detail" or "summary" as they are keywords in the show ipv6 prefix-list command.

Router 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

Verify

In order to verify the routes received by router R1, use the show ipv6 route ospf command.

show ipv6 route ospf
In router 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.

In order to display the information about the IPv6 prefix list or prefix list entries, use the show ipv6 prefix-list detail command.

show ipv6 prefix-list
In router 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.

The Output Interpreter Tool (registered customers only) (OIT) supports certain show commands. Use the OIT to view an analysis of show command output.

Troubleshoot

There is currently no specific troubleshooting information available for this configuration.

Related Information

Updated: Mar 29, 2012
Document ID: 113489