Configuring an OSPFv3 Distribution List Using an IPv6 Prefix List as Input

An IPv6 prefix list can be used to filter OSPFv3 routes.
  1. Enter the show ipv6 ospf route command to verify the OSPFv3 routes.
    device> show ipv6 ospf route
      Current Route count: 5
        Intra: 3 Inter: 0 External: 2 (Type1 0/Type2 2)
        Equal-cost multi-path: 0
        Destination                    Options   Area             Cost Type2 Cost
        Next Hop Router                Outgoing Interface
    *IA 2001:db8:1::/64                --------- 10.0.0.1           0 0
        ::                             ve 10
    *E2 2001:db8:2::/64                --------- 0.0.0.0            10 0
        fe80::2e0:52ff:fe00:10         ve 10
    *IA 2001:db8:3::/64                V6E---R-- 0.0.0.0            11 0
        fe80::2e0:52ff:fe00:10         ve 10
    *IA 2001:db8:4::/64                --------- 0.0.0.0            10 0
        ::                             ve 11
    *E2 2001:db8:5::/64                --------- 0.0.0.0            10 0
        fe80::2e0:52ff:fe00:10         ve 10
  2. Enter the enable command to access privileged EXEC mode.
    device> enable
  3. Enter the configure terminal command to access global configuration mode.
    device# configure terminal
  4. Enter the ip router-id command to specify the router ID.
    device(config)# ip router-id 10.11.12.13
  5. Enter the ipv6 prefix-list command, using the deny keyword and specify a name.
    device(config)# ipv6 prefix-list filterOspfRoutes seq 5 deny 2001:db8:2::/642
    An IPv6 prefix list called “filterOspfRoutes” that denies route 2001:db8:2::/64 is configured.
  6. Enter the ipv6 prefix-list command using the PERMIT keyword and specify a name. Use the ge keyword to specify a prefix length greater than or equal to the ipv6-prefix/prefix-length arguments. Use the le keyword to specify a prefix length less than or equal to the ipv6-prefix/prefix-length arguments.
    device(config)# ipv6 prefix-list filterOspfRoutes seq 7 permit ::/0 ge 1 le 128
  7. Enter the ipv6 router ospf command to enter OSPFv3 router configuration mode and enable OSPFv3 on the device.
    device(config)# ipv6 router ospf
  8. Enter the distribute-list prefix-list command, using the in keyword and specifying a name to configure a distribution list that applies the filterOspfRoutes prefix list globally.
    device(config-ospf6-router)# distribute-list prefix-list filterOspfRoutes in
  9. Enter the exit command until you return to user EXEC mode.
    device(config-ospf6-router)# exit
  10. Enter the show ipv6 ospf route command to verify that route 2001:db8:2::/64 is now omitted from the route table.
    device> show ipv6 ospf route
      Current Route count: 4
        Intra: 3 Inter: 0 External: 1 (Type1 0/Type2 1)
        Equal-cost multi-path: 0
        Destination                    Options   Area             Cost Type2 Cost
        Next Hop Router                Outgoing Interface
    *IA 2001:db8:1::/64                --------- 10.0.0.1            0 0
        ::                             ve 10
    *IA 2001:db8:3::/64                V6E---R-- 0.0.0.0            11 0
        fe80::2e0:52ff:fe00:10         ve 10
    *IA 2001:db8:4::/64                --------- 0.0.0.0            10 0
        ::                             ve 11
    *E2 2001:db8:5::/64                --------- 0.0.0.0            10 0
        fe80::2e0:52ff:fe00:10         ve 10

The following example configures an IPv6 prefix list that is used to filter OSPFv3 routes. A distribution list is then configured and route 2001:db8:2::/64 is omitted from the OSPFv3 route table.

device> show ipv6 ospf route
device> enable
device# configure terminal
device(config)# ip router-id 10.11.12.13
device(config)# ipv6 prefix-list filterOspfRoutes seq 5 deny 2001:db8:2::/642
device(config)# ipv6 prefix-list filterOspfRoutes seq 7 permit ::/0 ge 1 le 128
device(config)# ipv6 router ospf
device(config-ospf6-router)# distribute-list prefix-list filterOspfRoutes in
device(config-ospf6-router)# exit
device> show ipv6 ospf route