IP Prefix List
ccnp-routing
Use IP prefix lists with ge and le matching and route maps to filter routes and change OSPF external route types in a worked redistribution example.
- Like an ACL for network prefixes
- Processes sequentially
- For example:
ip prefix-list PL1 seq 5 permit 10.1.1.0/24ip prefix-list PL1 seq 10 deny 0.0.0.0/0 le 32
gemeans minimum prefix lengthlemeans maximum prefix length- IP prefix list can be used to filter LSAs. We will see this later
- IP prefix list can be applied using route maps
Route Map
- A set of sequentially processed rules that can
matchcertain criteria andsetattributes. - Example:
R1(config)#route-map RM1 permit 10 R1(config-route-map)#match ip address prefix-list PL1 R1(config-route-map)#set metric-type type-1
Configuration Example
See the example on the Redistribution into OSPF page.R1#show ip route ospf Gateway of last resort is not set O E2 1.0.0.0/8 [110/20] via 10.10.1.2, 00:01:51, GigabitEthernet0/0We are asked to advertise the network 1.1.0.0 which has a subnet mask of minimum /24 and maximum /30 as E1 as opposed to E2 using a route-map
ASBR(config)#ip prefix-list PL1 seq 10 permit 1.0.0.0/8 ge 24 le 30 ASBR(config)#route-map CONN->OSPF permit ASBR(config-route-map)#match ip address prefix-list PL1 ASBR(config-route-map)#set metric-type 2 ASBR(config-route-map)#exit ASBR(config)#route-map CONN->OSPF permit 20 ASBR(config-route-map)#exit ASBR(config)#router ospf 1 ASBR(config-router)#redistribute connected subnets route-map CONN->OSPF ASBR(config-router)#no summary-address 1.0.0.0 255.0.0.0I issued
no summary-address 1.0.0.0 255.0.0.0 to override the changes of the last example
R1#show ip route ospf
Gateway of last resort is not set
1.0.0.0/8 is variably subnetted, 3 subnets, 3 masks
O E1 1.1.1.0/30 [110/21] via 10.10.1.2, 00:00:09, GigabitEthernet0/0
O E1 1.1.2.0/24 [110/21] via 10.10.1.2, 00:00:09, GigabitEthernet0/0
O E2 1.3.0.0/16 [110/20] via 10.10.1.2, 00:00:09, GigabitEthernet0/0