Understanding Wildcards / CIDR.

By | December 11, 2023

What Is IP Address Wildcards?

An IP address wildcard is a method used in network configurations to specify a range of IP addresses.

CIDR (Classless Inter-Domain Routing) is a method for allocating IP addresses and routing Internet Protocol packets. It was introduced in the early 1990s as a replacement for the traditional class-based IP addressing scheme, with the goal of improving both address space utilization and routing scalability.

In the class-based IP addressing system, addresses were divided into fixed classes (A, B, C, etc.), each with a predetermined size, leading to inefficient allocation of IP addresses. CIDR, on the other hand, allows for a more flexible distribution of IP addresses based on demand, thus optimizing the use of available address space.

Key Elements of CIDR


IP Addresses: CIDR uses IPv4 and IPv6 addresses. IPv4 addresses are 32-bit numbers, typically expressed in dotted-decimal format (e.g., 192.0.2.0), while IPv6 addresses are 128-bit, represented in hexadecimal format (e.g.,2001:0db8:85a3:0000:0000:8a2e:0370:7334).

Subnet Mask / Prefix Length: CIDR introduces the concept of a subnet mask or prefix length, which indicates the number of bits in the address that are used for network and subnetting. For example, in CIDR notation, 192.0.2.0/24 indicates that the first 24 bits of the IP address are used for network identification, with the remaining bits available for host addresses within that network.

Variable-Length Subnet Masking (VLSM): This allows subnets of various sizes to be created, which is more efficient than the fixed-size subnets in the class-based system. VLSM enables the division of an IP address space into subnets of different sizes, tailored to the specific number of hosts required.

Primary Purposes of CIDR

IPv6 subnet mask example
Efficient Utilization of IP Address Space: By allowing flexible allocation of IP addresses based on need, CIDR reduces the wastage of IP addresses, which is crucial given the limited number of available IPv4 addresses.

Improved Routing Scalability: CIDR facilitates the aggregation of routes into a single CIDR block in routing tables. This process, known as route aggregation or supernetting, reduces the size of routing tables, making internet routing more efficient and scalable.

Simplified Management: With CIDR, network administrators can allocate IP address ranges more effectively, tailor network sizes to specific requirements, and manage networks with greater flexibility.

Enhanced Network Security: By providing control over address allocation, CIDR can also contribute to network security strategies, such as limiting the range of addresses available to an external network.
It’s often used in access control lists (ACLs) in network devices like routers.
Wildcards are similar to subnet masks but work in reverse; bits set to ‘0’ indicate the corresponding bit in an IP address must match exactly, while bits set to ‘1’ indicate any value is acceptable for that bit. This allows network administrators to easily specify groups of IP addresses in network configurations, enhancing flexibility and control.

Example:

Subnet Mask for IP address 192.168.1.0 with a 255.255.255.0 mask will be 192.168.1.0 0.0.0.255.

This is sometimes called an inverse mask or a wildcard mask. When the value of the mask is written out into binary (0s and 1s), the results determine which address bits are to be considered in processing the traffic.

Mask Example:

The values for the subnet mask can be 128,192,224,240,248,252,254 and 255

Take network address 192.168.20.0 / 24 (class C)

Network Address (binary) 11000000.10101000.0001100. 00000000

Subnet mask 255.255.255.0 (decimal)

mask 11111111.11111111.11111111. 00000000 (binary)

Subtract the normal mask from 255.255.255.255 to determine the ACL inverse mask or wildcard. In this example, the inverse mask is determined for network address 192.168.20.0 with a normal mask of 255.255.255.0.

e.g #1

255.255.255.255

– 255.255.255.0

= 0. 0. 0. 255 – this is the wild card or inverse mask

e.g #2

A subnet mask of 255.255.255.192

i:e 255.255.255.255

-255.255.255.192

= 0. 0. 0. 63 (this is the wildcard)

Calculating wildcards is fun if you can understand that is just a simple subtraction of the netmask of a given IP address from 255.255.255.255.

Advantages of IP Address Wildcards:

Flexibility: Allows for specifying ranges of IP addresses in network configurations, offering greater control.
Efficiency in ACLs: Streamlines the process of setting up access control lists by grouping IP addresses.
Simplification: Makes network configuration more manageable, especially for large networks.


Disadvantages:

Complexity: Can be confusing to understand and implement correctly.
Risk of Errors: Incorrect configuration can lead to security vulnerabilities or network disruptions.
Limited Use Cases: Not all network devices or protocols support wildcards.

In summary, CIDR is a fundamental technology in modern IP networking, designed to ensure efficient utilization of IP addresses and scalable internet routing. It represents a significant step forward from the limitations of class-based IP addressing, aligning more closely with the dynamic and diverse requirements of contemporary network environments.

IP Address (IPv4) Explained

IP Address Subnetting

IPv6 Explained