About this task
An IP prefix list can be configured and applied to an OSPFv2 area.
Procedure
-
Enter the
configure terminal command to access global configuration mode.
device# configure terminal
-
Enter the
ip prefix-list command and specify a name.
device(config)# ip prefix-list mylist permit 10.1.0.0/16
Configures an IP prefix list named “mylist” that permits routes to network 10.1.0.0/16.
-
Enter the
router ospf command to enter OSPF router configuration mode and enable OSPFv2 on the device.
device(config)# router ospf
-
Enter the
area command to define an OSPFv2 area ID.
device(config-router-ospf-vrf-default-vrf)# area 1
-
Enter the
area prefix-list command and specify an area address and a prefix-list.
device(config-router-ospf-vrf-default-vrf)# area 1 prefix-list mylist out
Configures the device to use the IP prefix list “mylist” to determine which routes from Area 1 are advertised to other areas. The device advertises routes that fall within the 10.1.0.0/16 range to other areas because the IP prefix list explicitly permits these routes to be sent to other areas from Area 1.
Example
The following example onfigures an IP prefix list named “mylist” that permits routes to network 10.1.0.0/16. This list is used to determine which routes to send to Area 1.
device# configure terminal
device(config)# ip prefix-list mylist permit 10.1.0.0/16
device(config)# router ospf
device(config-router-ospf-vrf-default-vrf)# area 1
device(config-router-ospf-vrf-default-vrf)# area 1 prefix-list mylist out