Configuring an OSPFv3 Distribution List using a Route Map as input

A route map that matches internal routes 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 route-map command, using the permit keyword and specify a name.
    device(config)# route-map allowInternalRoutes permit 10
    A route map called “allowInternalRoutes” that permits a matching pattern is configured.
  6. Enter the match route-type command, using the internal keyword to match internal route types in the route map instance.
    device(config-routemap allowInternalRoutes)# match route-type internal
  7. Enter the exit command to return to global configuration mode.
    device(config-routemap allowInternalRoutes)# exit
  8. Enter the ipv6 router ospf command to enter OSPFv3 router configuration mode and enable OSPFv3 on the device.
    device(config)# ipv6 router ospf
  9. Enter the distribute-list route-map command, using the in keyword and specifying a name to create a distribution list a distribution list using the configured route map “allowInternalRoutes”.
    device(config-ospf6-router)# distribute-list route-map allowInternalRoutes in
  10. Enter the exit command until you return to user EXEC mode.
    device(config-ospf6-router)# exit
  11. Enter the show ipv6 ospf route command to verify that the external routes are omitted from the OSPFv3 route table.
    device> show ipv6 ospf route
      Current Route count: 3
        Intra: 3 Inter: 0 External: 0 (Type1 0/Type2 0)
        Equal-cost multi-path: 0
        Destination                    Options   Area             Cost Type2 Cost
        Next Hop Router                Outgoing Interface
    *IA 2001:db8:3001::/64            --------- 10.0.0.1             0 0
        ::                             ve 10
    *IA 2001:db8:3015::/64             V6E---R-- 0.0.0.0            11 0
        fe80::2e0:52ff:fe00:10         ve 10
    *IA 2001:db8:3020::/64             --------- 0.0.0.0            10 0
        ::                             ve 11

The following example configures a route map that is used to filter OSPFv3 routes. A distribution list is then configured and external routes 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)# route-map allowInternalRoutes permit 10
device(config-routemap allowInternalRoutes)# match route-type internal
device(config-routemap allowInternalRoutes)# exit
device(config)# ipv6 router ospf
device(config-ospf6-router)# distribute-list route-map allowinternalroutes in
device(config-ospf6-router)# exit
device> show ipv6 ospf route