CIDR Subnet Calculator
This free online subnet calculator can be used to calculate network configurations, using an IP or network address, a netmask, a Cisco wildcard mask or CIDR notation. The calculator can also be used to do reverse subnetting where the number of hosts is known, but the netmask is unknown. By giving a second netmask, it's possible to design subnets and supernets.
- 192.168.0.1: Simple Address in standard class
- 192.168.0.1/22: CIDR Notation
- 192.168.0.1 255.255.248.0: IP and Subnet mask
- 192.168.0.1 0.0.0.63: IP and Wildcard mask
- 192.168.0.1-192.168.0.10: IP range that must be covered
- 192.168.0.1#1000: Network with at least 1000 hosts
- 192.168.0.1/26/28: Partition a network into subnets
- 192.168.0.1/27/24: Subsumption of networks to a supernet
Please note: IP addresses can be cut off, if the remaining octets are just zero. So "8" is equal to "220.127.116.11" or "16.4" is equal to "18.104.22.168".
What is CIDR?
CIDR or Classless Inter Domain Routing was developed to reduce the increasing size of routing tables of large routers, which was quite hard with classful routing. The memory usage of classful routing is enormous, which results in unreasonable expensive hadware. But also the performance was compromised, since large tables need to be looked up without a more dynamic IP interval mechanism, like CIDR imposes. Another problem with a classful setup is, that the bandwidth usage is quite high when routers exchange their routing information.
Simply spoken, CIDR using address aggregation can be used to address multiple networks with one single routing entry. Consider this example, where a router needs to distribute traffic for eight separate networks through the gateway 192.168.1.1:
ip route 192.168.2.0/27 192.168.1.1 ip route 192.168.2.32/27 192.168.1.1 ip route 192.168.2.64/27 192.168.1.1 ip route 192.168.2.96/27 192.168.1.1 ip route 192.168.2.128/27 192.168.1.1 ip route 192.168.2.160/27 192.168.1.1 ip route 192.168.2.192/27 192.168.1.1 ip route 192.168.2.224/27 192.168.1.1
Without CIDR, the routing table would become quite large, as every network needs an own entry. With CIDR, the networks can be condensed into one single rule (using 192.168.2.64/27/24 syntax for the calculator):
ip route 192.168.2.0/24 192.168.1.1
Generally, within a subnet, two host addresses - all-zeros and one all-ones are reserved as network address and broadcast, respectively. For a /31 subnet with only two possible address, the number of usable addresses would be zero.
Wildcard: The wildcard is the inverse of the subnet mask. It is used by certain firewalls and routers like Cisco for access control list
Broadcast: The broadcast of a network is a reserved address to send a message to all hosts in the subnet. IP broadcast addresses can be used only as the destination IP address. IP routers do not forward network broadcast packets.