{"id":168971,"date":"2026-06-17T22:41:48","date_gmt":"2026-06-17T19:41:48","guid":{"rendered":"https:\/\/computingforgeeks.com\/?p=168971"},"modified":"2026-06-17T22:41:48","modified_gmt":"2026-06-17T19:41:48","slug":"subnetting-vlsm-explained","status":"publish","type":"post","link":"https:\/\/computingforgeeks.com\/subnetting-vlsm-explained\/","title":{"rendered":"VLSM Subnetting Explained: How to Subnet by Host Requirements"},"content":{"rendered":"<p>Carving a network into equal-size subnets wastes addresses. A point-to-point link with two routers does not need the same block you hand a 60-user LAN, yet fixed-length subnetting gives every segment the same mask. VLSM, variable-length subnet masking, fixes that: you size each subnet to the hosts it actually needs and pack them into one network with no gaps.<\/p>\n\n<p>This guide shows how to subnet by host requirements, then works a full VLSM design end to end: choosing each mask, allocating in the right order, checking for overlap, adding a subnet later, and confirming the result in a Cisco routing table. It assumes you can already <a href=\"https:\/\/computingforgeeks.com\/subnetting-by-network-requirements\/\">subnet by network requirements<\/a>; VLSM is the next step on the <a href=\"https:\/\/computingforgeeks.com\/quickly-prepare-for-ccna-200-301-exam\/\">CCNA 200-301<\/a> path. Every subnet below was allocated and overlap-checked by hand in June 2026.<\/p>\n\n<h2>Subnet by host requirements<\/h2>\n\n<p>When the requirement is &#8220;this segment needs N hosts,&#8221; pick the smallest mask where 2 to the power of the host bits, minus 2, is at least N. The minus 2 removes the network and broadcast addresses. Borrow the fewest host bits that still satisfy the requirement, which leaves the most space for everything else.<\/p>\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Hosts needed<\/th><th>Host bits<\/th><th>Usable (2^H minus 2)<\/th><th>Mask (from a \/24)<\/th><\/tr><\/thead><tbody><tr><td>2<\/td><td>2<\/td><td>2<\/td><td>\/30<\/td><\/tr><tr><td>up to 6<\/td><td>3<\/td><td>6<\/td><td>\/29<\/td><\/tr><tr><td>up to 14<\/td><td>4<\/td><td>14<\/td><td>\/28<\/td><\/tr><tr><td>up to 30<\/td><td>5<\/td><td>30<\/td><td>\/27<\/td><\/tr><tr><td>up to 62<\/td><td>6<\/td><td>62<\/td><td>\/26<\/td><\/tr><tr><td>up to 126<\/td><td>7<\/td><td>126<\/td><td>\/25<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n<h2>What VLSM is, and what it is not<\/h2>\n\n<p>VLSM means using more than one subnet mask within the same classful network. Splitting 192.168.10.0\/24 into a \/25, two \/26s, and a \/30 is VLSM. Using different masks on different networks is just ordinary classless addressing, not VLSM. There is no IOS command that turns VLSM on; it happens automatically when you assign different masks to interfaces inside one network.<\/p>\n\n<p>The catch the exam tests is routing-protocol support. A protocol can only carry VLSM if it advertises the mask with every route. Classful RIPv1 does not, so it cannot.<\/p>\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Routing protocol<\/th><th>Supports VLSM?<\/th><th>Why<\/th><\/tr><\/thead><tbody><tr><td>RIPv1<\/td><td>No<\/td><td>Classful: does not send the mask, auto-summarizes at classful boundaries<\/td><\/tr><tr><td>RIPv2<\/td><td>Yes<\/td><td>Sends the mask with each route<\/td><\/tr><tr><td>OSPFv2<\/td><td>Yes<\/td><td>Classless: mask carried per route<\/td><\/tr><tr><td>EIGRP<\/td><td>Yes<\/td><td>Classless: mask carried per route<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n<h2>Allocate the largest subnet first<\/h2>\n\n<p>The one rule that prevents most VLSM mistakes: allocate the subnet with the most hosts first, then the next largest, down to the \/30 links last. A large subnet needs a large contiguous block aligned to its mask boundary. If you hand out small subnets first, you can chop up the address space so no aligned block is left for the big one. Place the biggest rooms first; the closets fit in the space that remains.<\/p>\n\n<h2>A VLSM design worked end to end<\/h2>\n\n<p>Take 10.0.0.0\/24 and four segments: LAN-A needs 100 hosts, LAN-B needs 60, LAN-C needs 20, and a WAN link needs 2. Sort them largest to smallest, choose each mask from the host-requirement rule, then allocate from 10.0.0.0 upward, each subnet starting right after the previous one&#8217;s broadcast.<\/p>\n\n<p>LAN-A (100 hosts) takes a \/25, which starts at 10.0.0.0 and ends at 10.0.0.127. LAN-B (60) takes a \/26 starting at the next free address, 10.0.0.128. LAN-C (20) takes a \/27 at 10.0.0.192. The WAN link (2) takes a \/30 at 10.0.0.224. Here is the full allocation:<\/p>\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Segment<\/th><th>Hosts<\/th><th>Mask<\/th><th>Subnet ID<\/th><th>Usable range<\/th><th>Broadcast<\/th><\/tr><\/thead><tbody><tr><td>LAN-A<\/td><td>100<\/td><td>\/25<\/td><td>10.0.0.0<\/td><td>10.0.0.1 to 10.0.0.126<\/td><td>10.0.0.127<\/td><\/tr><tr><td>LAN-B<\/td><td>60<\/td><td>\/26<\/td><td>10.0.0.128<\/td><td>10.0.0.129 to 10.0.0.190<\/td><td>10.0.0.191<\/td><\/tr><tr><td>LAN-C<\/td><td>20<\/td><td>\/27<\/td><td>10.0.0.192<\/td><td>10.0.0.193 to 10.0.0.222<\/td><td>10.0.0.223<\/td><\/tr><tr><td>WAN<\/td><td>2<\/td><td>\/30<\/td><td>10.0.0.224<\/td><td>10.0.0.225 to 10.0.0.226<\/td><td>10.0.0.227<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n<p>Four segments fit inside a single \/24 with room to spare, and not one address is wasted on the WAN link. Fixed-length subnetting would have forced every segment onto a \/25 and run out of space after two.<\/p>\n\n<h2>Check for overlapping subnets<\/h2>\n\n<p>Two subnets overlap when one&#8217;s address range falls inside another&#8217;s. The check is three steps: compute each subnet ID, compute its broadcast (subnet ID plus 2 to the power of the host bits, minus 1), then confirm the next subnet&#8217;s ID is greater than the previous broadcast. In the design above, each broadcast (.127, .191, .223, .227) is lower than the next subnet ID (.128, .192, .224), so nothing overlaps.<\/p>\n\n<p>The classic mistake: sizing LAN-C as 10.0.0.96\/27 instead of 10.0.0.192\/27. That \/27 spans 10.0.0.96 to 10.0.0.127, which sits inside LAN-A&#8217;s 10.0.0.0\/25 range (10.0.0.0 to 10.0.0.127). The two overlap, and IOS rejects the second address with an &#8220;overlaps with&#8221; error. Always check the new subnet&#8217;s range against every subnet already assigned.<\/p>\n\n<h2>Add a subnet to an existing design<\/h2>\n\n<p>Requirements change, and VLSM is built for it. Suppose LAN-D appears later and needs 10 hosts. Ten hosts needs 14 usable, which is a \/28. Find the lowest \/28 that does not overlap anything already used. The \/28 blocks fall on multiples of 16: 10.0.0.192 and 10.0.0.208 sit inside LAN-C&#8217;s \/27 (10.0.0.192 to 10.0.0.223), and 10.0.0.224 holds the WAN \/30. The first \/28 that is fully free is therefore 10.0.0.240.<\/p>\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Segment<\/th><th>Hosts<\/th><th>Mask<\/th><th>Subnet ID<\/th><th>Usable range<\/th><th>Broadcast<\/th><\/tr><\/thead><tbody><tr><td>LAN-D<\/td><td>10<\/td><td>\/28<\/td><td>10.0.0.240<\/td><td>10.0.0.241 to 10.0.0.254<\/td><td>10.0.0.255<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n<p>LAN-D slots into the gap between the WAN link and the end of the \/24 without disturbing any existing subnet. That is the whole point of planning largest-first: the leftover space stays usable.<\/p>\n\n<h2>Confirm VLSM in the routing table<\/h2>\n\n<p>Once the five subnets are live on a router, <code>show ip route<\/code> groups them under their classful parent and prints a header line that proves VLSM is active:<\/p>\n\n\n<pre class=\"wp-block-code code\"><code>10.0.0.0\/8 is variably subnetted, 5 subnets, 5 masks<\/code><\/pre>\n\n\n<p>Read it literally: five subnets of the 10.0.0.0 network are installed, and they use five different mask lengths (\/25, \/26, \/27, \/28, and \/30). The counts track whatever is actually configured, so before LAN-D was added the same line would read &#8220;4 subnets, 4 masks&#8221;. The phrase &#8220;variably subnetted&#8221; is the routing table confirming VLSM is in use. If a network is ever summarized back to \/8, a classful protocol such as RIPv1 is the usual cause.<\/p>\n\n<h2>Practice VLSM<\/h2>\n\n<p>VLSM is a calculation skill, so drill it. Use the trainer for the underlying network and broadcast math, then the quiz for the VLSM-specific decisions: mask choice by host count, allocation order, overlap, and protocol support.<\/p>\n\n<div class=\"cfg-subnet-trainer\"><div class=\"cfg-st-sub\">Loading subnetting trainer...<\/div><\/div>\n\n\n<p>The questions below check the VLSM judgement calls, each with a worked explanation.<\/p>\n\n<div class=\"cfg-quiz\" data-quiz=\"{\n  &quot;id&quot;: &quot;subnetting-vlsm&quot;,\n  &quot;title&quot;: &quot;VLSM practice quiz&quot;,\n  &quot;objective&quot;: &quot;1.6 Configure and verify IPv4 addressing and subnetting (VLSM)&quot;,\n  &quot;intro&quot;: &quot;VLSM questions on host-requirement masks, allocation order, overlap, protocol support, and reading the routing table. Every answer is computed or doc-checked.&quot;,\n  &quot;questions&quot;: [\n    {&quot;q&quot;: &quot;A subnet must support 50 hosts. What is the smallest mask that works?&quot;, &quot;options&quot;: [&quot;\/26&quot;, &quot;\/27&quot;, &quot;\/25&quot;, &quot;\/28&quot;], &quot;answer&quot;: 0, &quot;explanation&quot;: &quot;2^5 - 2 = 30 is too few; 2^6 - 2 = 62 covers 50, so \/26 is the smallest mask that fits.&quot;, &quot;validated&quot;: &quot;computed&quot;},\n    {&quot;q&quot;: &quot;What does VLSM actually mean?&quot;, &quot;options&quot;: [&quot;Using more than one subnet mask within the same classful network&quot;, &quot;Using one mask for the whole network&quot;, &quot;Subnetting across two different classful networks&quot;, &quot;Turning off classful routing&quot;], &quot;answer&quot;: 0, &quot;explanation&quot;: &quot;VLSM is variable-length subnet masking: more than one mask inside a single classful network, so each segment is sized to its host count.&quot;, &quot;validated&quot;: &quot;doc&quot;},\n    {&quot;q&quot;: &quot;Which routing protocol does NOT support VLSM?&quot;, &quot;options&quot;: [&quot;RIPv1&quot;, &quot;RIPv2&quot;, &quot;OSPFv2&quot;, &quot;EIGRP&quot;], &quot;answer&quot;: 0, &quot;explanation&quot;: &quot;RIPv1 does not advertise the subnet mask and auto-summarizes at classful boundaries, so it cannot carry VLSM. RIPv2, OSPFv2, and EIGRP all advertise the mask with each route.&quot;, &quot;validated&quot;: &quot;doc&quot;},\n    {&quot;q&quot;: &quot;In a VLSM design, which subnet should you allocate first?&quot;, &quot;options&quot;: [&quot;The subnet that needs the most hosts&quot;, &quot;The subnet that needs the fewest hosts&quot;, &quot;The point-to-point links&quot;, &quot;It does not matter&quot;], &quot;answer&quot;: 0, &quot;explanation&quot;: &quot;Allocate the largest subnet first, then work down to the \/30 links. Placing a small subnet first can strand the contiguous space a larger subnet needs later.&quot;, &quot;validated&quot;: &quot;doc&quot;},\n    {&quot;q&quot;: &quot;A LAN needs 100 hosts. Which mask is the most efficient choice?&quot;, &quot;options&quot;: [&quot;\/25&quot;, &quot;\/24&quot;, &quot;\/26&quot;, &quot;\/23&quot;], &quot;answer&quot;: 0, &quot;explanation&quot;: &quot;2^6 - 2 = 62 is too few; 2^7 - 2 = 126 covers 100, so \/25 is the smallest mask that fits.&quot;, &quot;validated&quot;: &quot;computed&quot;},\n    {&quot;q&quot;: &quot;What is the best mask for a point-to-point WAN link between two routers?&quot;, &quot;options&quot;: [&quot;\/30&quot;, &quot;\/29&quot;, &quot;\/31&quot;, &quot;\/28&quot;], &quot;answer&quot;: 0, &quot;explanation&quot;: &quot;A \/30 gives exactly 2 usable addresses, one per router, wasting the least space for a two-endpoint link.&quot;, &quot;validated&quot;: &quot;computed&quot;},\n    {&quot;q&quot;: &quot;LAN-A is 10.0.0.0\/25. Does 10.0.0.128\/26 overlap it?&quot;, &quot;options&quot;: [&quot;No, the \/25 ends at 10.0.0.127&quot;, &quot;Yes, they share addresses&quot;, &quot;Only the broadcast overlaps&quot;, &quot;Yes, \/26 is inside \/25&quot;], &quot;answer&quot;: 0, &quot;explanation&quot;: &quot;10.0.0.0\/25 spans .0 to .127 (broadcast .127). The next subnet starts at .128, which is above .127, so there is no overlap.&quot;, &quot;validated&quot;: &quot;computed&quot;},\n    {&quot;q&quot;: &quot;How many usable hosts does a \/27 subnet provide?&quot;, &quot;options&quot;: [&quot;30&quot;, &quot;32&quot;, &quot;14&quot;, &quot;62&quot;], &quot;answer&quot;: 0, &quot;explanation&quot;: &quot;2^5 - 2 = 30 usable host addresses in a \/27.&quot;, &quot;validated&quot;: &quot;computed&quot;},\n    {&quot;q&quot;: &quot;An existing design uses up to 10.0.0.227 (a \/30 ending at .227). You add a 10-host subnet (\/28). Which is the next non-overlapping \/28?&quot;, &quot;options&quot;: [&quot;10.0.0.240\/28&quot;, &quot;10.0.0.224\/28&quot;, &quot;10.0.0.228\/28&quot;, &quot;10.0.0.232\/28&quot;], &quot;answer&quot;: 0, &quot;explanation&quot;: &quot;\/28 boundaries fall on multiples of 16 (.224, .240). The .224\/28 block overlaps the \/30 already using .224 to .227, so the next free \/28 is 10.0.0.240\/28 (.240 to .255).&quot;, &quot;validated&quot;: &quot;computed&quot;},\n    {&quot;q&quot;: &quot;A routing table shows \\&quot;10.0.0.0\/8 is variably subnetted, 5 subnets, 4 masks\\&quot;. What does it mean?&quot;, &quot;options&quot;: [&quot;Five subnets of the 10.0.0.0 network are installed using four different masks&quot;, &quot;The network has five masks and four subnets&quot;, &quot;VLSM failed and summarized to \/8&quot;, &quot;There are five routers and four links&quot;], &quot;answer&quot;: 0, &quot;explanation&quot;: &quot;The line confirms VLSM is active: five subnets under the 10.0.0.0 classful parent are in the table, and they use four distinct masks.&quot;, &quot;validated&quot;: &quot;doc&quot;}\n  ]\n}\n\" data-quiz-count=\"8\"><div class=\"cfg-quiz-loading\">Loading quiz...<\/div><\/div>\n\n\n<h2>VLSM quick-reference card<\/h2>\n\n<p>Keep this beside you while you practice. It is the whole method in six lines.<\/p>\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Rule<\/th><th>What it does<\/th><\/tr><\/thead><tbody><tr><td>2^H minus 2 is at least N<\/td><td>Pick the mask: H host bits for N hosts<\/td><\/tr><tr><td>Allocate largest first<\/td><td>Biggest subnet, then down to the \/30 links<\/td><\/tr><tr><td>Start after the last broadcast<\/td><td>Next subnet ID is the previous broadcast plus 1<\/td><\/tr><tr><td>Overlap check<\/td><td>Next subnet ID must be above the previous broadcast<\/td><\/tr><tr><td>Protocol support<\/td><td>RIPv2, OSPFv2, EIGRP yes; RIPv1 no<\/td><\/tr><tr><td>&#8220;variably subnetted&#8221; in show ip route<\/td><td>Confirms VLSM is active<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n<p>With VLSM in hand, addressing stops being a source of wasted space and overlap errors, and you are ready for the routing topics that assume a clean, efficient address plan. For every mask, host count, and wildcard on one page, keep the <a href=\"https:\/\/computingforgeeks.com\/subnetting-cheat-sheet\/\">subnetting cheat sheet<\/a> within reach.<\/p>","protected":false},"excerpt":{"rendered":"<p>Carving a network into equal-size subnets wastes addresses. A point-to-point link with two routers does not need the same block you hand a 60-user LAN, yet fixed-length subnetting gives every segment the same mask. VLSM, variable-length subnet masking, fixes that: you size each subnet to the hosts it actually needs and pack them into one &#8230; <a title=\"VLSM Subnetting Explained: How to Subnet by Host Requirements\" class=\"read-more\" href=\"https:\/\/computingforgeeks.com\/subnetting-vlsm-explained\/\" aria-label=\"Read more about VLSM Subnetting Explained: How to Subnet by Host Requirements\">Read more<\/a><\/p>\n","protected":false},"author":3,"featured_media":168970,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[299,55],"tags":[524,525],"cfg_series":[39888],"class_list":["post-168971","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-how-to","category-networking","tag-ccna","tag-cisco","cfg_series-ccna-200-301"],"_links":{"self":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts\/168971","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/comments?post=168971"}],"version-history":[{"count":1,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts\/168971\/revisions"}],"predecessor-version":[{"id":168974,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts\/168971\/revisions\/168974"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/media\/168970"}],"wp:attachment":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/media?parent=168971"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/categories?post=168971"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/tags?post=168971"},{"taxonomy":"cfg_series","embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/cfg_series?post=168971"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}