IP Prefix Lists

IP prefix lists provide mechanisms to match two components of an IP route:

  • The route prefix (the subnet number)
  • The prefix length (the subnet mask)

The redistribute command cannot directly reference a prefix list, but a route map can refer to a prefix list by using the match command.

A prefix list itself has similar characteristics to a route map. The list consists of one or more statements with the same text name. Each statement has a sequence number to allow deletion of individual commands, and insertion of commands into a particular sequence position. Each command has a permit or deny action—but because it is used only for matching packets, the permit or deny keyword just implies whether a route is matched (permit) or not (deny). The generic command syntax is as follows:

ip prefix-list list-name [seq seq-value] {deny network/length | permit network/ length}[ge ge-value] [le le-value]

The sometimes tricky and interesting part of working with prefix lists is that the meaning of the network/length, ge-value, and le-value parameters changes depending on the syntax. The network! length parameters define the values to use to match the route prefix. For example, a network!length of 10.0.0.0/8 means "any route that begins with a 10 in the first octet." The ge and le options are used for comparison to the prefix length—in other words, to the number of binary 1s in the subnet mask. For instance, ge 20 le 22 matches only routes whose masks are /20, /21, or /22. So, prefix list logic can be summarized into a two-step comparison process for each route:

  1. The route's prefix must be within the range of addresses implied by the prefix-list command's network!length parameters.
  2. The route's prefix length must match the range ofprefixes implied by the prefix-list command.

The potentially tricky part of the logic relates to knowing the range of prefix lengths checked by this logic. The range is defined by the ge-value and le-value parameters, which stand for greater-than-or-equal-to and less-than-or-equal-to. Table 11-4 formalizes the logic, including the default values for ge-value and le-value. In the table, note that conf-length refers to the prefix length configured in the network/prefix (required) parameter, and route-length refers to the prefix length of a route being examined by the prefix list.

Table 11-4 LE and GE Parameters on IP Prefix List, and the Implied Range of Prefix Lengths

Prefix List Parameters

Range of Prefix Lengths

Neither

conf-length = route-length

Only le

conf-length <= route-length <= le-value

Only ge

ge-value <= route-length <= 32

Both ge and le

ge-value <= route-length <= le-value

Several examples can really help nail down prefix list logic. The following routes will be examined by a variety of prefix lists, with the routes numbered for easier reference:

1.

10.0.0.0/8

2.

10.128.0.0/9

3.

10.1.1.0/24

4.

10.1.2.0/24

5.

10.128.10.4/30

6.

10.128.10.8/30

Next, Table 11-5 shows the results of seven different one-line prefix lists applied to these six example routes. The table lists the matching parameters in the prefix-list commands, omitting the first part of the commands. The table explains which of the six routes would match the listed prefix list, and why.

Table 11-5 Example Prefix Lists Applied to the List of Routes

prefix-list Command Parameters

Routes Matched

Results

10.0.0.0/8

1

Without ge or le configured, both the prefix (10.0.0.0) and length (8) must be an exact match.

10.128.0.0/9

None

Without ge or le configured, the prefix (10.128.0.0) and length (9) must be an exact match, so none of the routes match.

10.0.0.0/8 ge 9

2-6

The 10.0.0.0/8 means "all routes whose first octet is 10," effectively representing an address range. The prefix length must be between 9 and 32, inclusive.

10.0.0.0/8 ge 24 le 24

3, 4

The 10.0.0.0/8 means "all routes whose first octet is 10," and the prefix range is 24 to 24—meaning only routes with prefix length 24.

Table 11-5 Example Prefix Lists Applied to the List of Routes (Continued)

prefix-list Command Parameters

Routes Matched

Results

10.0.0.0/8 le 28

1-4

The prefix length needs to be between 8 and 28, inclusive.

0.0.0.0/0

None

0.0.0.0/0 means "match all prefixes, with prefix length of exactly 0." So, it would match all routes' prefixes, but none of their prefix lengths. Only a default route would match this prefix list.

0.0.0.0/0 le 32

All

The range implied by 0.0.0.0/0 is all IPv4 addresses. The le 32 then implies any prefix length between 0 and 32, inclusive. This is the syntax for "match all" prefix list logic.

Continue reading here: The Mechanics of the redistribute Command

Was this article helpful?

+28 -9

Readers' Questions

  • bisirat yemane
    What does 10.0.0.0/8 mean?
    9 months ago
  • 10.0.0.0/8 is an IP address range represented in CIDR notation. In this case, the "/8" represents the subnet mask or network prefix length. It indicates that the first 8 bits are the network portion of the IP address, while the remaining 24 bits are available for assigning to devices on that network. The IP address range 10.0.0.0/8 includes all IP addresses starting with 10.x.x.x, where x can range from 0 to 255. This provides a total of 16,777,216 (2^24) possible IP addresses within that subnet.
    • benjamin bayer
      What does 10.0 0.0 8 mean?
      9 months ago
    • The phrase "10.0 0.0 8" seems to be a combination of three separate numbers: 10.0, 0.0, and 8. However, without further context, it is unclear what these numbers represent and their significance. They could represent various things depending on the context in which they are used, such as coordinates, measurements, quantities, or any other numerical values.
      • amaranth
        What does 10.0.0.0/8 mean?
        10 months ago
      • 10.0.0.0/8 is a notation used in network addressing. It represents a range of IP addresses within the Class A private IP address space. Explanation: - 10.0.0.0 is the designated network address. - The "/8" indicates the subnet mask, which is written in CIDR (Classless Inter-Domain Routing) notation. - In CIDR notation, the number after the slash represents the number of significant bits in the subnet mask. In this case, it means the subnet mask is 8 bits long. - With an 8-bit subnet mask, the range of IP addresses would be from 10.0.0.0 to 10.255.255.255. - This range provides a total of 16,777,216 (2^24) possible IP addresses. In summary, "10.0.0.0/8" refers to a block of IP addresses ranging from 10.0.0.0 to 10.255.255.255, where the first 8 bits represent the network portion of the address.
        • ELLA
          What does 10.0 0.0 8 mean?
          10 months ago
        • It is unclear what "10.0 0.0 8" refers to as it appears to be three separate numbers or values. Without further context or explanation, it is difficult to determine its specific meaning.
          • WANDA ROLES
            What does 0.0.0.0/0 mean?
            11 months ago
          • 0.0.0.0/0 is a notation used in computer networking to represent the IP address range. It is referred to as a "default route" or "default gateway." In IP addressing, an IP address consists of four sets of numbers ranging from 0 to 255, separated by periods. Each set represents 8 bits of the address, resulting in a total of 32 bits in the address. The /0 after 0.0.0.0 represents the subnet mask or network mask. By specifying 0.0.0.0/0 as the subnet mask, it indicates that the IP address range covers all possible addresses in the IPv4 address space. In other words, 0.0.0.0/0 represents all IP addresses, regardless of their actual values. It is often used as a default route or gateway, indicating that any traffic not explicitly routed elsewhere should be sent to this address.
            • aziza
              What does 10.0 0.0 8 mean?
              11 months ago
            • The sequence "10.0 0.0 8" appears to be three different numbers separated by spaces. Without additional context or information, it is difficult to determine the specific meaning or significance of these numbers. They could represent various measurements, coordinates, values, or any other numerical data.
              • taylor
                What does 10.0.0.0/8 mean?
                11 months ago
              • 10.0.0.0/8 is a notation used in IP address subnetting to denote a range of IP addresses within the Class A private network address space. Breaking down the notation: - 10.0.0.0 is the network address or the base address of the IP range. - "/8" indicates the subnet mask, which specifies the number of bits used for the network portion of the address. In this case, it indicates that the first 8 bits (or the first octet) of the IP address are used for the network, while the remaining 24 bits are available for host addresses. To understand the range of IP addresses included in 10.0.0.0/8, you can calculate it as follows: - In binary form, /8 means the subnet mask is 11111111.00000000.00000000.00000000. - The network address (10.0.0.0) in binary is 00001010.00000000.00000000.00000000. - The range of usable IP addresses within this subnet is from 10.0.0.1 to 10.255.255.254 (excluding the network and broadcast addresses). Therefore, 10.0.0.0/8 represents a large address space that accommodates up to 16,777,214 hosts on multiple subnets within the private network range.
                • martina
                  What does 10.0 0.0 8 mean?
                  12 months ago
                • "10.0 0.0 8" is a sequence of three numbers. Without further context, it is difficult to determine the specific meaning of these numbers. They could be numeric values representing different quantities or measurements.
                  • satu
                    What does 10.0.0.0/8 mean?
                    12 months ago
                  • 10.0.0.0/8 is a notation for representing an IP address range. In this notation, the number after the slash (/) indicates the number of bits in the network prefix. In the case of 10.0.0.0/8, it means that the first 8 bits of the IP address are part of the network prefix, while the remaining 24 bits can be used to represent specific hosts within that network. The range represented by 10.0.0.0/8 includes all IP addresses starting with "10." (e.g., 10.0.0.1, 10.1.2.3, 10.255.255.255), with the first 8 bits defining the network and the last 24 bits defining hosts within that network.
                    • WILLIAM
                      What does 0.0.0.0/0 mean?
                      12 months ago
                    • 0.0.0.0/0 is a network subnet mask that represents all possible IP addresses. It is known as the default route or default gateway and is used to indicate that all IP addresses are included within the specified network. In simpler terms, 0.0.0.0/0 means any IP address from any network is allowed.
                      • valerie
                        What does 0.0.0.0/0 mean?
                        1 year ago
                      • The notation 0.0.0.0/0 in networking represents a range of IP addresses covering all possible IP addresses. It is called a "wildcard" or "default" route. It means that any IP address can match this network or subnet. In other words, all IP addresses, no matter the range or structure, are included in this network. This notation is often used in routing tables to represent the default route, which is used when there is no other specific route available for a given destination.
                        • Marie
                          What does 10.0.0.0/8 mean?
                          1 year ago
                        • The notation "10.0.0.0/8" represents an IP address range in the IPv4 addressing system. It signifies a network with a subnet mask of 255.0.0.0, which allows for 2^24 (16,777,216) individual IP addresses. In this specific case, "10.0.0.0/8" refers to a private IP address range reserved for internal networks. It includes all addresses from 10.0.0.0 to 10.255.255.255. It can be used by organizations to assign IP addresses to devices on their private networks without requiring global internet access.
                          • kacy
                            What is w03 prefex in ip control?
                            1 year ago
                          • W03 is a three-letter abbreviation for Windows 2003, and it is commonly used to refer to a network running on the Microsoft Windows Server 2003 operating system. It is also sometimes used as a prefix in the IP address of computers on the network, for example, W03-192.168.1.1.
                            • Austin Fraser
                              How are public ip prefixes routed?
                              1 year ago
                            • Public IP prefixes are routed through the Border Gateway Protocol (BGP). BGP is an exterior routing protocol which allows for communication between network devices on different networks. BGP forwards and directs traffic across the Internet through the exchange of network reachability information and utilizes route aggregation to minimize the size of routing tables.
                              • Stephan
                                What does the internet prefix www stand for?
                                1 year ago
                              • WWW stands for World Wide Web.
                                • logan ritchie
                                  Where to find network prefix length?
                                  1 year ago
                                • Network prefix length can typically be found in the settings of your router or modem, or in the settings of your computer or other device if you are connected to the network. You may also be able to find the network prefix length listed in the terms and conditions of your internet service provider.
                                  • omar
                                    What does the /32 prefix listed in the route table indicate?
                                    1 year ago
                                  • A /32 prefix in a route table indicates that the route entry is for an individual host, as opposed to a network or subnet.
                                    • Kifle
                                      What is subnet prefix length?
                                      1 year ago
                                    • Subnet prefix length is a number that indicates the length of the prefix of a subnet in CIDR notation. It is the number of bits used to identify the subnet, and is also known as the prefix length or prefix size.
                                      • Angelika
                                        How ge and le works prefix list?
                                        1 year ago
                                      • GE and LE are prefixes used to indicate that a certain number or amount is greater than or equal to (GE) or less than or equal to (LE) the number that follows. For example, GE 5 would mean five or more, and LE 10 would mean ten or fewer.
                                        • Kirsti
                                          What is a network of length when the prefix length is /48?
                                          1 year ago
                                        • A network of length /48 is a network with 65536 consecutive IPv6 addresses.
                                          • Kimberley
                                            Which routes are covered in prefix list le?
                                            1 year ago
                                          • Prefix list le typically covers the routes 0.0.0.0/0, 128.0.0.0/1, 192.0.0.0/2, 224.0.0.0/3, 240.0.0.0/4.
                                            • Martina
                                              What is prefix list in networking?
                                              1 year ago
                                            • Prefix lists are a type of access list used to filter routes. They use an extended access list format and function similar to route maps. They are used to filter routes based on specific prefixes, such as source and destination networks. They are applied to routing protocols for the purpose of controlling both inbound and outbound traffic.
                                              • sayid zula
                                                What is prefix list in cisco?
                                                1 year ago
                                              • A prefix list, also known as an access control list (ACL), is a set of rules used to filter or control the traffic flow in a Cisco router. It is used to control the advertisements and route acceptance in the Border Gateway Protocol (BGP) and Interior Gateway Protocols (IGPs) such as OSPF and EIGRP. Prefix lists are used to match and filter IP prefixes based on their network addresses or address ranges. They allow network administrators to permit or deny specific IP ranges from being advertised or accepted by routers. Each rule in a prefix list consists of a permit or deny statement followed by a network address/prefix and a prefix length. The list is processed top-down, and the first matching rule is applied. If no match is found, the default is usually to deny the traffic. Prefix lists are more flexible and granular than traditional access control lists (ACLs) as they allow specifying the exact network addresses and prefixes. They are commonly used in BGP route filtering and route redistribution scenarios to control the routing advertisements and traffic flows within a network.