Classless Inter-Domain Routing (CIDR)

1 - About

Classless Inter-Domain Routing (CIDR) is a notation that defines a subnet

3 - Syntax

CIDR notation: IP Address/prefix

where:

4 - Example

4.1 - The world


0.0.0.0/0

where:

  • 0.0.0.0 is the wildcard IP address that match any possible machines

4.2 - Only one IP


x.x.x.x/32

where the routing prefix 32 means that there is only one host on this network.

Example:


143.176.206.82/32

5 - Operation

5.1 - Range to Cidr

In Postgress from numeric IP with inet_merge


SELECT 
    inet_merge(
        '0.0.0.0'::inet + ip_from, 
        '0.0.0.0'::inet + ip_to
   ) 
from ip where ctry = 'NL';

6 - Documentation / Reference


Data Science
Data Analysis
Statistics
Data Science
Linear Algebra Mathematics
Trigonometry

Powered by ComboStrap