Configuring an OSPFv3 Distribution List Using an IPv6 Prefix List as Input
An IPv6 prefix list 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
ipv6 prefix-listcommand, using the deny keyword and specify a name.An IPv6 prefix list called “filterOspfRoutes” that denies route 2001:db8:2::/64 is configured. - Enter the
ipv6 prefix-listcommand 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. - Enter the
ipv6 router ospfcommand to enter OSPFv3 router configuration mode and enable OSPFv3 on the device. - Enter the
distribute-list prefix-listcommand, using the in keyword and specifying a name to configure a distribution list that applies the filterOspfRoutes prefix list globally. - Enter the
exitcommand until you return to user EXEC mode. - Enter the
show ipv6 ospf routecommand 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