Wednesday 22 May 2019

OSPF Series 8: Prefix Lists

Prefix Lists

Example 1)

access-list 1 permit 1.2.3.0 0.0.0.255
ip prefix-list LIST permit 0.0.0.0/0 le 32
This means:

Check the first 0 bits of the prefix 0.0.0.0 The subnet mask must be less than or equal to 32 This equates to anything

Example 2)

ip prefix-list LIST permit 0.0.0.0/0
This means:

The exact prefix 0.0.0.0, with the exact prefix­length 0. This is matching a default route.

Example 3)

ip prefix-list LIST permit 10.0.0.0/8 ge 21 le 29
This means:

Check the first 8 bits of the prefix 10.0.0.0 The subnet mask must be greater than or equal to 21, and less than or equal to 29.

Example 4)

ip prefix-list CLASS_A permit 0.0.0.0/1 ge 8 le 8

This matches all class A addresses with classful masks. It means: Check the first bit of the prefix, it must be a 0.

The subnet mask must be greater than or equal to 8, and less than or equal to 8. ( It is exactly 8 )

When using the GE and LE values, you must satisfy the condition: Len < GE <= LE

Therefore “ip prefix­list LIST permit 1.2.3.0/24 ge 8″ is not a valid list.

What you can not do with the prefix­list is match on arbitrary bits like you can in an access­list. Prefix­lists cannot be used to check if a number is even or odd, nor check if a number is divisible by 15, etc… Bit checking in a prefix­list is sequential, starting with the most significant (leftmost) bit.

No comments:

Post a Comment