Using prefix-list example scenarios

Prefix lists are used to filter routes based on prefix and subnet masks. The following are some prefix-list examples. Prefix list can be applied directly on a neighbor statement for BGP or using a route-map

! Match only – more specific. Only the below prefix with /24 is permitted
ip prefix-list LIST1

!Matches prefix and a mask bteen 24-30 (24,25,26,27,28,29,30)
ip prefix-list LIST2 ge 24 le 30

!Matches only default route
ip prefix-list DEFAULT permit

! Matches any prefixes with masks between 0 and 32
ip prefix-list ANY permit le 32

The following is an example of use with BGP

ip prefix-list LIST1 permit
ip prefix-list LIST2 permit ge 8 le 16

router bgp 100
neighbor prefix-list LIST1 in
neighbor prefix-list LIST2 out