{"id":829,"date":"2026-09-19T14:48:49","date_gmt":"2026-09-19T14:48:49","guid":{"rendered":"https:\/\/www.vps.tc\/blog\/?p=829"},"modified":"2026-09-19T09:21:03","modified_gmt":"2026-09-19T09:21:03","slug":"what-is-cidr-ip-range-calculation","status":"publish","type":"post","link":"https:\/\/www.vps.tc\/blog\/en\/what-is-cidr-ip-range-calculation\/","title":{"rendered":"What Is CIDR? A Practical Guide to IP Range Calculation"},"content":{"rendered":"<div class=\"aiw-summary\" id=\"aiw-ozet\">\n<p class=\"aiw-summary-title\">Quick Summary &#8211; CIDR and IP Range Calculation<\/p>\n<p>CIDR combines an IP address with a prefix length to describe a network boundary. Calculate the block size, then compare the result with the server&#039;s routes before changing firewall or DHCP rules.<\/p>\n<ul>\n<li><strong>Read the prefix<\/strong> \u2014 The number after the slash identifies how many bits belong to the network.<\/li>\n<li><strong>Count addresses<\/strong> \u2014 An IPv4 prefix uses 2^(32-prefix) to calculate the total address count.<\/li>\n<li><strong>Find boundaries<\/strong> \u2014 Calculate the network and broadcast addresses before assigning hosts.<\/li>\n<li><strong>Know exceptions<\/strong> \u2014 IPv4 \/31 point-to-point links and \/32 host routes do not follow ordinary subnet assumptions.<\/li>\n<li><strong>Check Linux<\/strong> \u2014 Use ip, ipcalc, and the route table to compare your calculation with the kernel&#039;s decision.<\/li>\n<li><strong>Test firewall rules<\/strong> \u2014 Keep remote access available and prepare a rollback before applying a CIDR rule.<\/li>\n<\/ul>\n<\/div>\n<p class=\"aiw-lead\">CIDR is a compact way to describe an IP network by writing an address and prefix length together, such as 192.168.1.0\/24. The prefix tells you how many bits identify the network; the remaining bits determine the range size and possible host addresses.<\/p>\n<div class=\"aiw-toc\" style=\"border:1px solid #dbe3ea;border-radius:8px;padding:16px 20px;margin:0 0 28px\">\n<p class=\"aiw-toc-head\"><strong>Table of Contents<\/strong><span class=\"aiw-toc-meta\"> \u00b7 13 min read<\/span><\/p>\n<ol style=\"margin:10px 0 0;padding-left:22px\">\n<li><a href=\"#what-cidr-actually-tells-you\">What CIDR Actually Tells You<\/a><\/li>\n<li><a href=\"#how-many-addresses-fit-in-a-24-26-or-30\">How Many Addresses Fit in a \/24, \/26, or \/30?<\/a><\/li>\n<li><a href=\"#calculating-a-cidr-range-by-hand\">Calculating a CIDR Range by Hand<\/a><\/li>\n<li><a href=\"#cidr-and-dotted-subnet-masks-say-the-same-thing\">CIDR and Dotted Subnet Masks Say the Same Thing<\/a><\/li>\n<li><a href=\"#checking-cidr-on-linux\">Checking CIDR on Linux<\/a><\/li>\n<li><a href=\"#ipv6-uses-cidr-too\">IPv6 Uses CIDR Too<\/a><\/li>\n<li><a href=\"#using-cidr-in-firewalls-and-routes\">Using CIDR in Firewalls and Routes<\/a><\/li>\n<li><a href=\"#vlsm-different-sizes-inside-one-network\">VLSM: Different Sizes Inside One Network<\/a><\/li>\n<li><a href=\"#mistakes-i-check-before-applying-a-cidr-rule\">Mistakes I Check Before Applying a CIDR Rule<\/a><\/li>\n<li><a href=\"#my-cidr-verification-workflow\">My CIDR Verification Workflow<\/a><\/li>\n<li><a href=\"#before-applying-a-cidr-change\">Before Applying a CIDR Change<\/a><\/li>\n<li><a href=\"#frequently-asked-questions\">Frequently Asked Questions<\/a><\/li>\n<li><a href=\"#sources\">Sources<\/a><\/li>\n<\/ol>\n<\/div>\n<h2 id=\"what-cidr-actually-tells-you\">What CIDR Actually Tells You<\/h2>\n<p>The slash in <code>192.168.1.0\/24<\/code> is doing real work. It tells you where the network portion ends and the host portion begins, which is why the same IP address can mean very different things with a different prefix.<\/p>\n<p>CIDR, short for Classless Inter-Domain Routing, writes an address and prefix length together instead of relying on the old fixed Class A, B, and C boundaries. In <code>192.168.1.0\/24<\/code>, the first 24 bits identify the network. The remaining 8 bits provide 256 IPv4 addresses; in a conventional subnet, 254 are normally assignable to hosts.<\/p>\n<p>RFC 4632 describes CIDR as a way to allocate IPv4 space more precisely and keep routing tables from growing unnecessarily. The prefix is not a host count. That distinction is where many firewall mistakes begin.<\/p>\n<p>A CIDR block gives you four useful pieces of information:<\/p>\n<ul>\n<li><strong>Network address:<\/strong> The first address in the block.<\/li>\n<li><strong>Prefix length:<\/strong> The number after the slash, such as <code>\/26<\/code>.<\/li>\n<li><strong>Total addresses:<\/strong> For IPv4, <code>2^(32-prefix)<\/code>.<\/li>\n<li><strong>Conventionally usable addresses:<\/strong> The total after excluding the network and broadcast addresses in an ordinary subnet.<\/li>\n<\/ul>\n<p><strong>Write the pair together.<\/strong> An IP address without its prefix does not tell you the complete range.<\/p>\n<h2 id=\"how-many-addresses-fit-in-a-24-26-or-30\">How Many Addresses Fit in a \/24, \/26, or \/30?<\/h2>\n<p>An IPv4 address has 32 bits. A longer prefix leaves fewer bits for hosts, so the range gets smaller. The calculation is <code>2^(32-n)<\/code>, where <code>n<\/code> is the prefix length.<\/p>\n<table>\n<thead>\n<tr>\n<th>CIDR<\/th>\n<th>Subnet mask<\/th>\n<th>Total addresses<\/th>\n<th>Conventionally usable<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\/16<\/td>\n<td>255.255.0.0<\/td>\n<td>65,536<\/td>\n<td>65,534<\/td>\n<\/tr>\n<tr>\n<td>\/24<\/td>\n<td>255.255.255.0<\/td>\n<td>256<\/td>\n<td>254<\/td>\n<\/tr>\n<tr>\n<td>\/25<\/td>\n<td>255.255.255.128<\/td>\n<td>128<\/td>\n<td>126<\/td>\n<\/tr>\n<tr>\n<td>\/26<\/td>\n<td>255.255.255.192<\/td>\n<td>64<\/td>\n<td>62<\/td>\n<\/tr>\n<tr>\n<td>\/27<\/td>\n<td>255.255.255.224<\/td>\n<td>32<\/td>\n<td>30<\/td>\n<\/tr>\n<tr>\n<td>\/28<\/td>\n<td>255.255.255.240<\/td>\n<td>16<\/td>\n<td>14<\/td>\n<\/tr>\n<tr>\n<td>\/29<\/td>\n<td>255.255.255.248<\/td>\n<td>8<\/td>\n<td>6<\/td>\n<\/tr>\n<tr>\n<td>\/30<\/td>\n<td>255.255.255.252<\/td>\n<td>4<\/td>\n<td>2<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The word <em>conventionally<\/em> matters. In an ordinary IPv4 subnet, the first address is the network address and the last is the broadcast address. In <code>203.0.113.0\/24<\/code>, for example, <code>203.0.113.0<\/code> identifies the network and <code>203.0.113.255<\/code> is the broadcast address. Hosts would normally use <code>203.0.113.1<\/code> through <code>203.0.113.254<\/code>.<\/p>\n<p><code>\/31<\/code> and <code>\/32<\/code> need separate treatment. RFC 3021 permits <code>\/31<\/code> on point-to-point IPv4 links, where both addresses can be assigned to the two interfaces. A <code>\/32<\/code> represents one IPv4 address and is common for loopbacks, host routes, and narrow firewall matches.<\/p>\n<p><strong>Match the use case.<\/strong> Subtract network and broadcast addresses for an ordinary subnet, but do not apply that rule mechanically to a <code>\/31<\/code> point-to-point link.<\/p>\n<div class=\"aiw-callout aiw-callout-tip\">\n<p class=\"aiw-callout-label\">Tip<\/p>\n<p>The prefix is not a host count. In \/26, 26 bits identify the network and 6 bits remain, producing 64 total IPv4 addresses.<\/p>\n<\/div>\n<h2 id=\"calculating-a-cidr-range-by-hand\">Calculating a CIDR Range by Hand<\/h2>\n<p>I still calculate small ranges by hand when I am working over SSH. It is faster than opening a browser, and it gives me a way to sanity-check a tool&#8217;s output. Let us use <code>192.168.10.77\/26<\/code>.<\/p>\n<ol>\n<li><strong>Find the mask:<\/strong> <code>\/26<\/code> corresponds to <code>255.255.255.192<\/code>.<\/li>\n<li><strong>Calculate the block size:<\/strong> In the final octet, calculate <code>256 - 192 = 64<\/code>.<\/li>\n<li><strong>List block starts:<\/strong> The possible starts are <code>0<\/code>, <code>64<\/code>, <code>128<\/code>, and <code>192<\/code>.<\/li>\n<li><strong>Place the IP in a block:<\/strong> <code>77<\/code> falls between <code>64<\/code> and <code>127<\/code>, so the network address is <code>192.168.10.64<\/code>.<\/li>\n<li><strong>Find the broadcast:<\/strong> It is one address before the next block: <code>192.168.10.127<\/code>.<\/li>\n<\/ol>\n<p>The usable host range is <code>192.168.10.65<\/code> through <code>192.168.10.126<\/code>. The original <code>.77<\/code> address is inside that range, so it is a host address, not the network address.<\/p>\n<p>For <code>10.20.5.130\/27<\/code>, the mask is <code>255.255.255.224<\/code> and the block size is 32. The relevant blocks are <code>96-127<\/code> and <code>128-159<\/code>. The network is <code>10.20.5.128<\/code>, the broadcast is <code>10.20.5.159<\/code>, and usable hosts run from <code>10.20.5.129<\/code> through <code>10.20.5.158<\/code>.<\/p>\n<p><strong>Verify the boundary.<\/strong> Write the network, broadcast, and host range together before creating a firewall or DHCP rule.<\/p>\n<div class=\"aiw-callout aiw-callout-example\">\n<p class=\"aiw-callout-label\">Example<\/p>\n<p>For 192.168.10.77\/26, the block size is 64. The address belongs to 192.168.10.64\/26, with 192.168.10.127 as the broadcast address.<\/p>\n<\/div>\n<h2 id=\"cidr-and-dotted-subnet-masks-say-the-same-thing\">CIDR and Dotted Subnet Masks Say the Same Thing<\/h2>\n<p>CIDR notation and dotted-decimal subnet masks describe the same network boundary in different forms. <code>172.16.40.0\/20<\/code> and <code>172.16.40.0<\/code> combined with <code>255.255.240.0<\/code> identify the same block. CIDR is shorter; the dotted mask can be easier to read on older network equipment.<\/p>\n<table>\n<thead>\n<tr>\n<th>CIDR<\/th>\n<th>Dotted mask<\/th>\n<th>Block boundary<\/th>\n<th>Example range<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\/20<\/td>\n<td>255.255.240.0<\/td>\n<td>16 in the third octet<\/td>\n<td>172.16.32.0 &#8211; 172.16.47.255<\/td>\n<\/tr>\n<tr>\n<td>\/22<\/td>\n<td>255.255.252.0<\/td>\n<td>4 in the third octet<\/td>\n<td>172.16.40.0 &#8211; 172.16.43.255<\/td>\n<\/tr>\n<tr>\n<td>\/28<\/td>\n<td>255.255.255.240<\/td>\n<td>16 in the fourth octet<\/td>\n<td>192.0.2.16 &#8211; 192.0.2.31<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The examples use documentation space such as <code>192.0.2.0\/24<\/code> and private space from <code>172.16.0.0\/12<\/code>. I prefer that over copying a real customer address into a tutorial.<\/p>\n<p>If a firewall, router, or cloud panel accepts CIDR, you might enter <code>10.10.0.0\/16<\/code>. An older interface may ask for <code>255.255.0.0<\/code> instead. A typo such as <code>255.255.255.0<\/code> changes the range from 65,536 addresses to 256, so I check the conversion rather than trusting muscle memory.<\/p>\n<h2 id=\"checking-cidr-on-linux\">Checking CIDR on Linux<\/h2>\n<p>On Linux, I start with the <code>ip<\/code> command. It shows what is actually configured, not what I remember configuring earlier in the day.<\/p>\n<pre><code>ip -4 addr show\nip -4 route<\/code><\/pre>\n<p>The first command lists IPv4 addresses and prefixes on the interfaces. The second displays the kernel&#8217;s connected routes and default route. If a VPS provider has supplied a gateway or an additional address block, compare this output with the provider&#8217;s network details.<\/p>\n<p>For a direct calculation, use <code>ipcalc<\/code> if it is installed:<\/p>\n<pre><code>ipcalc 192.168.10.77\/26<\/code><\/pre>\n<p>It normally prints the network, broadcast, host range, wildcard mask, and host count. On Debian and Ubuntu, the package is generally also named <code>ipcalc<\/code>, although it is not installed by default everywhere. If it is missing, do not invent a firewall rule just because a utility is unavailable. Calculate it by hand or use a calculator you have already checked.<\/p>\n<p>To see which interface and source address the kernel would choose for a destination, run:<\/p>\n<pre><code>ip route get 192.168.10.77<\/code><\/pre>\n<p>Look at the <code>dev<\/code>, <code>src<\/code>, and, where present, <code>via<\/code> fields. They matter on a VPS with multiple interfaces or policy routes.<\/p>\n<p>I once trusted an address assignment and assumed the route was obvious. It was not. The route lookup showed the kernel&#8217;s actual decision, and since then I compare the address, prefix, and route before changing network rules.<\/p>\n<p><strong>Compare the outputs.<\/strong> Check the calculated network against both <code>ip -4 addr<\/code> and <code>ip -4 route<\/code>.<\/p>\n<div class=\"aiw-callout aiw-callout-field\">\n<p class=\"aiw-callout-label\">From the field<\/p>\n<p>I once trusted an interface assignment without checking the route table. The route lookup showed what the kernel would actually do, so I now compare address, prefix, and route before changing network rules.<\/p>\n<\/div>\n<h2 id=\"ipv6-uses-cidr-too\">IPv6 Uses CIDR Too<\/h2>\n<p>IPv6 has 128-bit addresses, but the CIDR idea is unchanged. In <code>2001:db8:1234:10::\/64<\/code>, the first 64 bits identify the network prefix and the remaining 64 bits are available for interface identifiers. RFC 4291 describes the IPv6 addressing architecture and unicast address structure.<\/p>\n<p>IPv6 has no broadcast address, and it does not use the IPv4 rule that reserves a network and broadcast address in every subnet. An IPv6 <code>\/64<\/code> therefore contains <code>2^64<\/code> possible addresses mathematically. That does not mean I would put an unlimited number of devices on one LAN; routing, automatic configuration, and security policy still set the practical boundaries.<\/p>\n<ul>\n<li><code>\/48<\/code>: Often assigned to an organization or site.<\/li>\n<li><code>\/56<\/code>: Can give a customer or home connection multiple subnets.<\/li>\n<li><code>\/64<\/code>: Common for one IPv6 link or LAN.<\/li>\n<li><code>\/128<\/code>: Represents one IPv6 address, such as a loopback or host route.<\/li>\n<\/ul>\n<p>When planning IPv6, leave room for route summarization and future subnet growth. Do not carry the IPv4 habit of avoiding the first and last address directly into IPv6.<\/p>\n<p><strong>Plan the prefix.<\/strong> Choose it for routing and future growth, not only for the number of devices you have today.<\/p>\n<h2 id=\"using-cidr-in-firewalls-and-routes\">Using CIDR in Firewalls and Routes<\/h2>\n<p>CIDR lets you describe a set of addresses without listing every address separately. For example, <code>198.51.100.0\/24<\/code> could represent an office network allowed to reach SSH. That one rule covers 256 IPv4 addresses, so I would verify the whole network before trusting it.<\/p>\n<p>An nftables rule accepting SSH from that IPv4 subnet could look like this:<\/p>\n<pre><code>nft add rule inet filter input ip saddr 198.51.100.0\/24 tcp dport 22 accept<\/code><\/pre>\n<p>This matches IPv4 sources only. IPv6 needs a separate rule using <code>ip6 saddr<\/code> and an IPv6 prefix. Also remember that a rule entered at the shell is not automatically persistent; persistence depends on how nftables is configured on your distribution.<\/p>\n<p>The same boundary appears in web servers, reverse proxies, and application access lists. An application behind a proxy may see the proxy&#8217;s address instead of the client&#8217;s. Before enforcing a CIDR restriction, identify which layer makes the decision and accept headers such as <code>X-Forwarded-For<\/code> only from trusted proxies.<\/p>\n<p>A <code>\/32<\/code> matches one IPv4 address. A <code>\/24<\/code> matches 256. Confusing those two in an administration rule can lock out an office, or expose an entire network when you meant to permit one host.<\/p>\n<p><strong>Test narrowly.<\/strong> Keep an existing SSH session open, test from a known source, and prepare the rollback command before applying a remote firewall change.<\/p>\n<div class=\"aiw-callout aiw-callout-warn\">\n<p class=\"aiw-callout-label\">Caution<\/p>\n<p>A \/24 firewall rule covers 256 IPv4 addresses, while \/32 covers one. Check the scope before allowing SSH or management access.<\/p>\n<\/div>\n<h2 id=\"vlsm-different-sizes-inside-one-network\">VLSM: Different Sizes Inside One Network<\/h2>\n<p>Variable Length Subnet Masking, or VLSM, means using different subnet sizes inside one larger network. In <code>192.168.50.0\/24<\/code>, I could allocate a <code>\/26<\/code> for an office, a <code>\/27<\/code> for a lab, and a <code>\/28<\/code> for servers.<\/p>\n<table>\n<thead>\n<tr>\n<th>Purpose<\/th>\n<th>Block<\/th>\n<th>Usable range<\/th>\n<th>Address count<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Office<\/td>\n<td>192.168.50.0\/26<\/td>\n<td>.1 &#8211; .62<\/td>\n<td>62<\/td>\n<\/tr>\n<tr>\n<td>Laboratory<\/td>\n<td>192.168.50.64\/27<\/td>\n<td>.65 &#8211; .94<\/td>\n<td>30<\/td>\n<\/tr>\n<tr>\n<td>Servers<\/td>\n<td>192.168.50.96\/28<\/td>\n<td>.97 &#8211; .110<\/td>\n<td>14<\/td>\n<\/tr>\n<tr>\n<td>Future use<\/td>\n<td>192.168.50.112\/28<\/td>\n<td>.113 &#8211; .126<\/td>\n<td>14<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Each subnet starts on the correct boundary after the previous one ends. A <code>\/27<\/code> advances in steps of 32, while a <code>\/28<\/code> advances in steps of 16. Starting a subnet at an arbitrary address creates collisions between DHCP ranges, static addresses, and routes. Those collisions are tedious to untangle later.<\/p>\n<p>For DHCP planning, see <a href=\"https:\/\/www.vps.tc\/blog\/en\/windows-server-dhcp-setup\/\">How to Install and Configure DHCP on Windows Server<\/a>. If you need to identify which device owns an address on a local network, <a href=\"https:\/\/www.vps.tc\/blog\/en\/what-is-arp-address-resolution-protocol-explained\/\">What Is ARP? Address Resolution Protocol Explained<\/a> covers the underlying address-resolution process.<\/p>\n<p><strong>Leave room.<\/strong> Document gateways, static servers, management interfaces, and future reservations instead of treating every currently unused address as free.<\/p>\n<h2 id=\"mistakes-i-check-before-applying-a-cidr-rule\">Mistakes I Check Before Applying a CIDR Rule<\/h2>\n<p>The first mistake is treating the prefix as a host count. <code>\/24<\/code> does not mean 24 hosts. It leaves 8 host bits, producing 256 total IPv4 addresses.<\/p>\n<p>Another mistake is assuming that the final octet is automatically the network address. For <code>192.168.1.77\/26<\/code>, the network is <code>192.168.1.64<\/code>; <code>.77<\/code> is a host inside that block. The <code>\/26<\/code> boundaries are 0, 64, 128, and 192.<\/p>\n<p>Cloud networking adds another trap. Some VPS providers assign a public address as <code>\/32<\/code> and deliver the default gateway through a provider-specific setup. The gateway shown in the panel does not always have to sit inside the apparent interface subnet. Follow the provider&#8217;s documentation and inspect the route table.<\/p>\n<p>IPv4 and IPv6 rules are not automatically combined. A rule for <code>192.0.2.0\/24<\/code> says nothing about IPv6. On a dual-stack VPS, check <code>nft list ruleset<\/code>, listening addresses, and access logs for both protocol families.<\/p>\n<p>Finally, keep the scope narrow until the result is proven. Test from a controlled source, keep the current SSH session open, and have a rollback path before making the rule persistent. Network mistakes can lock you out before an application log gives you anything useful.<\/p>\n<p>For the underlying terminology, see <a href=\"https:\/\/www.vps.tc\/blog\/en\/what-is-an-ip-address-and-how-does-it-work\/\">What Is an IP Address and How Does It Work?<\/a> If your question is about traffic capacity rather than address space, <a href=\"https:\/\/www.vps.tc\/blog\/en\/vps-bandwidth-explained-how-much-do-you-need\/\">VPS Bandwidth Explained: How Much Do You Need?<\/a> covers a different calculation.<\/p>\n<p><strong>Review the boundary.<\/strong> Before deploying a rule, confirm the prefix, address count, protocol family, and rollback path.<\/p>\n<h2 id=\"my-cidr-verification-workflow\">My CIDR Verification Workflow<\/h2>\n<p>When I define a new network block, I use this order:<\/p>\n<ol>\n<li>Record the complete IP and prefix from the network plan or hosting provider.<\/li>\n<li>Convert the prefix into a subnet mask and total address count.<\/li>\n<li>Calculate the network and broadcast addresses.<\/li>\n<li>Reserve gateways, DNS, DHCP, and static addresses.<\/li>\n<li>Check the route table and intended interface.<\/li>\n<li>Test the firewall rule with a narrow scope before making it persistent.<\/li>\n<li>Keep the plan in IPAM, Git, or another document the on-call person can reach.<\/li>\n<\/ol>\n<p>A quick command-line check can start here:<\/p>\n<pre><code>ip -4 addr show dev eth0\nip -4 route\nip route get 198.51.100.10<\/code><\/pre>\n<p>The interface may not be called <code>eth0<\/code>. Modern systems often use names such as <code>ens3<\/code>, <code>enp1s0<\/code>, or a provider-specific virtual interface. Replace it before running the first command.<\/p>\n<p><strong>Apply changes safely.<\/strong> Keep a second SSH session open while changing remote network rules, and have the rollback command ready before you press Enter.<\/p>\n<h2 id=\"before-applying-a-cidr-change\">Before Applying a CIDR Change<\/h2>\n<ul class=\"aiw-checklist\">\n<li>Write down the complete IP address and prefix.<\/li>\n<li>Convert the prefix to a subnet mask.<\/li>\n<li>Calculate the network and broadcast addresses.<\/li>\n<li>Count the total and usable addresses.<\/li>\n<li>Check the route table and intended interface.<\/li>\n<li>Test the rule from a controlled source.<\/li>\n<li>Keep a second SSH session and rollback command ready.<\/li>\n<\/ul>\n<div class=\"aiw-cta\">\n<p>Keep your CIDR calculation next to the route and firewall change that depends on it. The extra minute of checking is cheaper than recovering from a locked-out VPS.<\/p>\n<p class=\"aiw-cta-action\"><a href=\"https:\/\/www.vps.tc\/en\/vps\">Explore VPS plans<\/a><\/p>\n<\/div>\n<h2 id=\"frequently-asked-questions\">Frequently Asked Questions<\/h2>\n<div class=\"aiw-faq\">\n<details class=\"aiw-faq-item\" open>\n<summary>What is CIDR in simple terms?<\/summary>\n<p>CIDR is a notation for describing an IP network with a prefix length, such as 192.168.1.0\/24. The \/24 says that the first 24 bits identify the network, leaving 8 bits for addresses inside it. CIDR replaced fixed Class A, B, and C boundaries and allows networks to be sized more precisely.<\/p>\n<\/details>\n<details class=\"aiw-faq-item\">\n<summary>How many usable IP addresses does a \/24 have?<\/summary>\n<p>A standard IPv4 \/24 contains 256 total addresses because 8 host bits remain. In a conventional subnet, the first address identifies the network and the last is used for broadcast, leaving 254 commonly usable host addresses. Point-to-point links and other special cases can follow different rules.<\/p>\n<\/details>\n<details class=\"aiw-faq-item\">\n<summary>How do I calculate the range for 192.168.10.77\/26?<\/summary>\n<p>Convert \/26 to 255.255.255.192, then calculate the block size as 256 &#8211; 192 = 64. The blocks begin at 0, 64, 128, and 192 in the final octet. Since 77 falls in the 64-127 block, the network is 192.168.10.64, the broadcast is .127, and usable hosts are .65-.126.<\/p>\n<\/details>\n<details class=\"aiw-faq-item\">\n<summary>What is the difference between CIDR and a subnet mask?<\/summary>\n<p>They describe the same boundary in different notation. The CIDR form \/20 is a prefix length, while 255.255.240.0 is the equivalent dotted-decimal subnet mask. CIDR is shorter and common in routing tables and firewall rules; the dotted mask can be easier to recognize on older network equipment.<\/p>\n<\/details>\n<details class=\"aiw-faq-item\">\n<summary>What do \/31 and \/32 mean?<\/summary>\n<p>A \/31 contains two IPv4 addresses and is commonly used on point-to-point links under RFC 3021, where both addresses can be assigned to interfaces. A \/32 identifies exactly one IPv4 address. It is often used for loopbacks, host routes, or firewall rules matching one source.<\/p>\n<\/details>\n<details class=\"aiw-faq-item\">\n<summary>Does IPv6 use CIDR the same way as IPv4?<\/summary>\n<p>Yes. IPv6 uses a prefix length after a slash, but addresses contain 128 bits rather than 32. An IPv6 \/64 leaves 64 bits after the network prefix and represents 2^64 possible addresses. IPv6 has no broadcast, so the IPv4 practice of reserving network and broadcast addresses should not be copied directly.<\/p>\n<\/details>\n<\/div>\n<h2 id=\"sources\">Sources<\/h2>\n<ul class=\"aiw-sources\">\n<li><a href=\"https:\/\/www.rfc-editor.org\/rfc\/rfc4632\" target=\"_blank\" rel=\"noopener\">RFC 4632 &#8211; Classless Inter-domain Routing<\/a> \u2014 rfc-editor.org<\/li>\n<li><a href=\"https:\/\/www.rfc-editor.org\/rfc\/rfc3021\" target=\"_blank\" rel=\"noopener\">RFC 3021 &#8211; Using 31-Bit Prefixes on IPv4 Point-to-Point Links<\/a> \u2014 rfc-editor.org<\/li>\n<li><a href=\"https:\/\/www.rfc-editor.org\/rfc\/rfc4291\" target=\"_blank\" rel=\"noopener\">RFC 4291 &#8211; IPv6 Addressing Architecture<\/a> \u2014 rfc-editor.org<\/li>\n<li><a href=\"https:\/\/www.rfc-editor.org\/rfc\/rfc791\" target=\"_blank\" rel=\"noopener\">RFC 791 &#8211; Internet Protocol<\/a> \u2014 rfc-editor.org<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Understand CIDR prefixes, calculate IPv4 and IPv6 ranges, convert subnet masks, and avoid firewall and routing mistakes on your VPS.<\/p>\n","protected":false},"author":2,"featured_media":827,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-829","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-general"],"lang":"en","translations":{"en":829,"tr":828},"pll_sync_post":[],"_links":{"self":[{"href":"https:\/\/www.vps.tc\/blog\/wp-json\/wp\/v2\/posts\/829","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vps.tc\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vps.tc\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vps.tc\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vps.tc\/blog\/wp-json\/wp\/v2\/comments?post=829"}],"version-history":[{"count":1,"href":"https:\/\/www.vps.tc\/blog\/wp-json\/wp\/v2\/posts\/829\/revisions"}],"predecessor-version":[{"id":831,"href":"https:\/\/www.vps.tc\/blog\/wp-json\/wp\/v2\/posts\/829\/revisions\/831"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.vps.tc\/blog\/wp-json\/wp\/v2\/media\/827"}],"wp:attachment":[{"href":"https:\/\/www.vps.tc\/blog\/wp-json\/wp\/v2\/media?parent=829"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vps.tc\/blog\/wp-json\/wp\/v2\/categories?post=829"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vps.tc\/blog\/wp-json\/wp\/v2\/tags?post=829"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}