IT PATH
My Path

IP Addressing and Subnetting

Plan and calculate IPv4 and IPv6 addressing, subnet boundaries, and host capacity confidently.

Certification
CompTIA Network+
Recommended study time
6h 35m
Status
Not started

Recommended study time

About 6h 35m in total, measured from the material on this page. At your session length of 45 minutes that is 9 sittings.

  • Read the lesson21 min

    About 2,763 words at a careful technical reading pace.

  • Second pass with notes13 min

    Re-read the harder parts and write your own notes.

  • Recall from memory12 min

    2 written recall questions.

  • Practice decision12 min

    One applied decision with feedback.

  • Teach it back20 min

    Write the topic in your own words.

  • Real-world scenario15 min

    Read the situation and justify your decision in writing.

  • Hands-on practice3h 20m

    Labs, commands and configuration until you can do it unaided.

  • Spaced review1h 40m

    4 short review sessions spread over the following weeks.

Learning objectives

  • Calculate network, broadcast, and usable host ranges for any IPv4 prefix.
  • Design a subnet plan that matches host counts to prefix lengths.
  • Explain IPv6 address structure, prefixes, and common address types.

Start here

About 9 minutes of reading, in 10 short parts.

IP addressing and subnetting is the arithmetic that decides which devices can talk to each other directly and which need a router in between. It looks intimidating at first because it involves binary numbers, but it is really just consistent, repeatable maths once you know the rules. Every network design, firewall rule, and VPN configuration depends on getting this right.

Where you meet it: A network engineer is asked to connect two newly acquired offices by VPN and discovers both use the exact same address range, which makes routing between them ambiguous until one side is renumbered.

The lesson, part by part

Open one part at a time. Each part stands on its own, so you can stop and come back.

An IP address is like a street address with two parts: the town and the house number. Devices in the same 'town' can deliver mail directly to each other's door. Devices in different towns need the mail routed through a postal depot, which in networking is the role of a router. Subnetting is simply deciding how big each 'town' is and where its boundary falls.

If you make a town too small, you run out of house numbers for new residents. If you make it too big, mail meant for one house gets shouted to every house in the town unnecessarily, wasting effort. Subnetting is the skill of sizing each town correctly for how many houses it will actually need.

Key ideas

If you remember nothing else from this topic, remember these.

  • An IPv4 address combined with a subnet mask splits into a network portion and a host portion, and only devices sharing the same network portion can communicate without a router.
  • Subnet masks and CIDR notation describe the same thing two different ways: 255.255.255.0 is exactly equivalent to /24.
  • Subnetting a network borrows bits from the host portion to create smaller networks, which reduces the usable host count per subnet but increases the number of subnets available.
  • Every subnet reserves the first address as the network address and the last address as the broadcast address, leaving the range in between as usable host addresses.
  • Private address ranges defined in RFC 1918, such as 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16, are not routable on the public internet and require NAT to reach it.
  • VLSM (Variable Length Subnet Masking) allows different subnets within the same network to use different mask lengths, matching subnet size to actual host requirements instead of wasting addresses.

Splitting a /24 into four equal subnets for four office floors

A worked example, step by step.

An office has been assigned 192.168.10.0/24 and needs to split it into four equally sized subnets, one per floor, each needing fewer than 60 hosts.

  1. 01Determine bits neededFour subnets require borrowing 2 host bits, since 2 squared equals 4, moving the mask from /24 to /26.
  2. 02Calculate the block sizeA /26 mask leaves 6 host bits, giving 2 to the 6th power equals 64 addresses per subnet, comfortably covering 60 hosts once network and broadcast addresses are subtracted.
  3. 03List subnet 1192.168.10.0/26 covers addresses .0 through .63; network address .0, usable range .1 to .62, broadcast .63.
  4. 04List subnet 2192.168.10.64/26 covers .64 through .127; network address .64, usable range .65 to .126, broadcast .127.
  5. 05List subnet 3192.168.10.128/26 covers .128 through .191; network address .128, usable range .129 to .190, broadcast .191.
  6. 06List subnet 4192.168.10.192/26 covers .192 through .255; network address .192, usable range .193 to .254, broadcast .255.
  7. 07Assign to floorsFloor 1 gets 192.168.10.0/26, Floor 2 gets 192.168.10.64/26, Floor 3 gets 192.168.10.128/26, Floor 4 gets 192.168.10.192/26.
  8. 08Verify a host addressA workstation configured with 192.168.10.70/26 is confirmed to sit in Floor 2's subnet, since .70 falls between .65 and .126.

Outcome: The single /24 is cleanly divided into four /26 subnets of 62 usable hosts each, matching the four-floor requirement without wasting the address space.

CIDR, masks, and host counts

Worth keeping at hand while you work.

/24 = 255.255.255.0
256 total addresses, 254 usable hosts
/25 = 255.255.255.128
128 total addresses, 126 usable hosts
/26 = 255.255.255.192
64 total addresses, 62 usable hosts
/27 = 255.255.255.224
32 total addresses, 30 usable hosts
/28 = 255.255.255.240
16 total addresses, 14 usable hosts
/29 = 255.255.255.248
8 total addresses, 6 usable hosts
/30 = 255.255.255.252
4 total addresses, 2 usable hosts, common for point-to-point router links
10.0.0.0/8
RFC 1918 private range, largest block
172.16.0.0/12
RFC 1918 private range, mid-size block
192.168.0.0/16
RFC 1918 private range, common for home and small office
169.254.0.0/16
APIPA range, self-assigned when DHCP fails
127.0.0.1
Loopback address referring to the local host

Common misunderstandings

What most beginners get wrong here.

  • A subnet mask changes the IP address itself.

    The subnet mask never changes the address; it defines which bits of the address represent the network versus the host.

  • The broadcast address of a subnet can be assigned to a host.

    The broadcast address is reserved for sending to every host in the subnet and can never be assigned to an individual device.

  • Borrowing more bits for subnetting always increases available hosts.

    Borrowing bits for subnetting increases the number of subnets while decreasing the number of usable hosts per subnet.

  • Private IP addresses like 192.168.1.1 can be reached directly from the internet.

    RFC 1918 private addresses are not routable on the public internet and require NAT on a router or firewall to communicate externally.

  • A /30 subnet has four usable host addresses.

    A /30 has only 4 total addresses, but the network and broadcast addresses consume two of them, leaving exactly 2 usable hosts, ideal for a point-to-point link.

Exam traps

How the question writers try to catch you out.

  • Network+ frequently gives an IP address and mask and asks for the network address, broadcast address, or usable host range, requiring actual binary or block-size math.
  • Watch for questions that give a required number of hosts and ask for the smallest adequate subnet mask, testing whether you round up correctly for the network and broadcast reservations.
  • Distractor answers often use the correct block size but shift the starting address by one, so always double check the network address boundary.
  • Questions about APIPA (169.254.x.x) test whether you recognize it as a sign of DHCP failure, not a normal working address.
  • VLSM questions expect you to size each subnet according to its own host requirement rather than giving every subnet the same mask.
  • Expect a question distinguishing 172.16.0.0/12 as a private range even though its 172.x.x.x prefix looks unfamiliar compared to 10.x or 192.168.x.

Check yourself

Answer in your head first, then reveal. This is not scored.

  • How many usable host addresses exist in a /27 subnet?

  • Given 192.168.5.130/26, what is the network address of that subnet?

  • Why is a /30 mask commonly used on router-to-router links?

  • What does it mean if a device shows an address in the 169.254.0.0/16 range?

  • What is the purpose of NAT in relation to private addressing?

  • If you need 4 equally sized subnets from a /22 network, what new mask do you use?

Quick reference

A condensed summary of the lesson above, for revision.

What It Is

An IPv4 address pairs a network portion and a host portion, split by the prefix length or subnet mask. The network address has all host bits zero; the broadcast has them all ones; usable hosts are 2^h minus two. CIDR notation writes the prefix directly. IPv6 uses 128-bit addresses, typically a /64 per LAN, with link-local, unique local, and global unicast types.

Why It Matters

Address planning determines segmentation, routing efficiency, and security boundaries. Bad plans force painful renumbering later, and misjudged prefixes either exhaust addresses or waste whole ranges.

How It Works

  • The mask ANDs with the address to produce the network identifier.
  • Hosts compare their own network identifier to the destination to decide local delivery or gateway forwarding.
  • Routers select the longest matching prefix in the routing table.

Where You See It

  • Network design documents, DHCP scope planning, firewall rules, VPN configuration, and cloud VPC design.

Key Terms

CIDR
Classless notation such as /24 expressing prefix length.
Broadcast address
The all-host-bits-set address for a subnet.
VLSM
Variable length subnet masking, sizing each subnet to its need.
Link-local
An address usable only on the local link, such as fe80::/10 in IPv6.
Supernet
A summarised route covering multiple smaller prefixes.

Examples

  • 192.168.10.0/26 gives 64 addresses, of which 62 are usable, with a broadcast at 192.168.10.63.
  • A point-to-point router link commonly uses a /30 or /31 to avoid wasting addresses.

Common Problems

  • Overlapping subnets
  • Mask mismatch between hosts
  • Exhausted DHCP scope
  • Wrong gateway for the subnet

How It Fails

  • Overlapping ranges across sites break VPN routing in both directions.
  • A /24 mask entered where /25 was intended lets one host believe remote peers are local.
  • Undersized scopes leave later users without addresses at peak occupancy.

How to Troubleshoot

  1. Compute the network and broadcast for each affected host and compare.
  2. Check for duplicate or overlapping ranges before blaming routing.
  3. Confirm the gateway address is inside the host's calculated subnet.

Practical Knowledge

  • Leave planned growth room but avoid oversized broadcast domains.
  • Document allocations centrally; spreadsheets beat undocumented tribal memory.

Exam Coverage

  • IPv4 subnetting and CIDR
  • VLSM and address planning
  • IPv6 addressing and types

Interview Questions

  • How many usable hosts are in a /27?
  • Two sites cannot reach each other over VPN and both use 192.168.1.0/24. What is wrong?

Watch and read

Verified official and reputable sources for this topic. Links open in a new tab.

Video training

  • Professor Messer's CompTIA N10-009 Network+ video course

    Professor Messer

    Video
    Free
    Watch

Reading and courses

  • Networking Basics

    Cisco Networking Academy

    Course
    Free
    Open
  • Networking Essentials

    Cisco Networking Academy

    Course
    Free
    Open
  • DNS concepts

    Cloudflare Docs

    Documentation
    Free
    Open

Lesson notes and bookmark

Notes and bookmarks for this lesson, saved with everything else you have marked.

No notes on this item yet.

Learning progress

0% across six evidence areas. Reading alone does not change progress.

Understanding0%
Recall0%
Application0%
Practical ability0%
Troubleshooting0%
Retention0%

Prerequisites

Next steps

  1. 01Calculate the range and usable hosts for 10.20.30.0/27 by hand.
  2. 02Find your device's IPv6 link-local address and identify its prefix.