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.
- Enter the
show ipv6 ospf routecommand 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 - Enter the
enablecommand to access privileged EXEC mode. - Enter the
configure terminalcommand to access global configuration mode. - Enter the
ip router-idcommand to specify the router ID. - Enter the
route-mapcommand, using the permit keyword and specify a name.A route map called “allowInternalRoutes” that permits a matching pattern is configured. - Enter the
match route-typecommand, using the internal keyword to match internal route types in the route map instance. - Enter the
exitcommand to return to global configuration mode. - Enter the
ipv6 router ospfcommand to enter OSPFv3 router configuration mode and enable OSPFv3 on the device. - Enter the
distribute-list route-mapcommand, using the in keyword and specifying a name to create a distribution list a distribution list using the configured route map “allowInternalRoutes”. - Enter the
exitcommand until you return to user EXEC mode. - Enter the
show ipv6 ospf routecommand 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