Skip to main content

What Do The Four Numbers In An IP Address Mean?

by
Last updated on 10 min read

An IPv4 address splits into network and host portions using CIDR notation. The first part (before the slash) identifies the network, while the last part (after the slash) determines how many bits belong to hosts. For example, in 192.168.1.100/24, the first 24 bits (192.168.1) are the network, and the last 8 bits (100) are the host.

What’s Really Happening

IPv4 addresses are 32-bit numbers split into four 8-bit octets. Each octet represents a decimal value from 0 to 255, and together they form a unique identifier for devices on a network. The slash notation (like /24) tells you how many bits are locked for the network—everything left of that slash is the "street address," while the rest is the "mailbox number."

Think of it like a street address. The first three numbers (192.168.1) point to the right neighborhood, while the last number (100) identifies the specific house. If you get the neighborhood wrong, your package (data) never arrives.

The CIDR notation isn’t just jargon—it’s a shorthand for the subnet mask. A /24 means the first 24 bits are fixed, leaving 8 bits free for hosts. Mess up the count, and your device ends up in the wrong subnet. Suddenly, your laptop can’t reach the printer, even though they’re in the same room.

Step-by-Step Solution

To fix connectivity issues, first confirm which bits are network and which are host, then verify the host can communicate. Start by checking your IP and subnet mask, split the address manually if needed, test reachability, and adjust the mask if something’s off.

  1. Find your IP and mask in one shot
    • Windows 10/11: Press Win + R, type cmd, hit Enter. Run:
      ipconfig /all
      Look for “IPv4 Address” and “Subnet Mask” under the correct adapter. (Pro tip: If you’re on Wi-Fi, scroll to the Wireless LAN adapter section.)
    • macOS Ventura 2025 / Sonoma 2026: Open Terminal. Run:
      ifconfig | grep -A 5 "inet " | grep -v 127.0.0.1
      Note the IPv4 address and the netmask in CIDR form. If it shows 192.168.1.100 netmask 0xffffff00, that’s the same as /24.
    • Ubuntu 24.04 LTS / Fedora 40: Open Terminal. Run:
      ip a
      Look for the interface (usually eth0 or wlan0). The address line will show something like “192.168.1.100/24”. If you see /24, you’re golden. If not, you’ve found your problem.
  2. Split the address by hand Take the CIDR you found (e.g., /24). Convert it to a dotted mask: /24 → 255.255.255.0. Write the 32-bit binary version for the IP and mask side-by-side. The bits where the mask is 1 are the network; the rest are the host. Example:
    Octet1921681100
    Binary IP11000000101010000000000101100100
    Binary Mask (24 bits)11111111111111111111111100000000
    Network Bits192.168.1(fixed)
    Host Bits(0)100

    If your mask is /16, the network bits would cover the first two octets (192.168), leaving the last two for hosts. That’s a much bigger network—good for offices, bad for home setups where you don’t need 65,000 possible addresses.

  3. Test reachability
    • Ping the host itself:
      ping 192.168.1.100
    • Ping the router (usually .1 in the same /24):
      ping 192.168.1.1

    If the first ping fails but the second works, your device is the issue. If both fail, your subnet mask is likely wrong, or the interface is down. Don’t overlook the simple stuff—sometimes the cable’s just unplugged.

  4. Fix the mask if needed
    • Windows: Settings → Network & Internet → Change adapter options → right-click adapter → Properties → IPv4 → Properties → enter the correct IP and 255.255.255.0. Click OK. (Honestly, this is the most straightforward way to set a static IP on Windows.)
    • macOS: System Settings → Network → Wi-Fi/Ethernet → Details → TCP/IP → Configure IPv4: “Manually”. Enter address 192.168.1.100, subnet mask 255.255.255.0, router 192.168.1.1. Save it, then reconnect.
    • Linux: sudo nano /etc/netplan/01-netcfg.yaml (Ubuntu) or sudo nmtui (Fedora). Set address to 192.168.1.100/24 and gateway to 192.168.1.1. sudo netplan apply or reboot. (If you’re using NetworkManager, nmcli works too.)

If This Didn’t Work

Common culprits include IP conflicts, wrong gateways, or disabled interfaces. Check these first before diving into advanced troubleshooting.

  • IP conflict – Two devices on the same /24 with the same host ID (e.g., both 192.168.1.100). Run arp -a (Windows) or ip neigh (Linux) to spot duplicates. Change the last octet on one device. (This happens more often than you’d think—especially with IoT devices that default to the same IP.)
  • Wrong gateway – If your router is 192.168.2.1 but you typed 192.168.1.1, traffic never leaves the local network. Double-check in Settings → TCP/IP → Router. (A single digit off can break everything.)
  • Interface disabled – On Windows, open Device Manager → Network adapters → right-click the adapter → Enable. On Linux, sudo ip link set eth0 up. On macOS, toggle Wi-Fi off/on. (Sometimes the simplest fix is the right one.)

Prevention Tips

Small habits can save you hours of troubleshooting later. Use DHCP reservations, label your cables, review your subnet annually, and always write CIDR notation.

  • Use DHCP reservations – Most home routers let you reserve an IP for a specific MAC address. That keeps the host bits consistent and prevents conflicts. (Your smart TV won’t suddenly forget its IP address after a power outage.)
  • Label your cables – Stick a tiny sticker on each Ethernet cable with the device name and the last octet (e.g., “Camera – .105”). A quick visual check beats guessing. (Trust me, in six months, you’ll thank past-you.)
  • Periodic subnet review – Once a year, print an “ipconfig /all” for every machine and verify the subnet mask hasn’t drifted. A /16 mask on a desktop that should be /24 quietly doubles the broadcast domain and slows the network. (This is one of those “set it and forget it” tasks that bites you later.)
  • Use CIDR notation everywhere – When you document an IP, always write the slash (e.g., 192.168.1.100/24) instead of the dotted mask. It removes ambiguity and matches router configs. (Future-you will appreciate this when troubleshooting from your phone.)

Can I use a /8 or /16 mask at home?

Technically yes, but it’s usually a bad idea. A /8 mask (255.0.0.0) gives you over 16 million possible addresses—way more than any home needs. Stick with /24 for simplicity.

Here’s the thing: A /8 mask might sound impressive, but it turns your local network into a chaotic free-for-all. Broadcast traffic explodes, devices get confused, and troubleshooting becomes a nightmare. Unless you’re running a data center in your basement, /24 is the sweet spot.

That said, some older home networks still use /16 (255.255.0.0) out of habit. If you’re one of those people, consider migrating. Your future self—and your router—will thank you.

What if my ISP gives me a /32?

A /32 mask means the entire address is the network—no host bits left. This is common with IPv6 but rare in IPv4 for home users. If you see this, your ISP is likely assigning a single public IP to your router.

In most cases, you won’t deal with a /32 at home. Your router handles the public IP, then hands out private IPs (like 192.168.1.x) to your devices. If you’re seeing a /32 on your local network, something’s misconfigured.

For example, if your ISP assigns 203.0.113.45/32, your router uses that as its public address. Your devices still get private IPs from the router’s DHCP pool. (This is normal—don’t panic if you see it on your WAN interface.)

How do I tell if my subnet mask is wrong?

Test connectivity first—if pings fail to local devices but work to the internet, your mask is likely wrong. Compare your subnet mask with other devices on the same network.

Here’s a quick test: Try pinging another device on your network, like your phone or a printer. If it works, your mask is probably fine. If it doesn’t, check your settings.

Another clue? If you can access the internet but not other devices on your local network, your subnet mask is almost certainly the culprit. (This is a classic sign—don’t overlook it.)

Why does my Linux box show /24 but my Windows box shows 255.255.255.0?

They’re the same thing—just different ways of writing it. CIDR (/24) and dotted-decimal (255.255.255.0) are two sides of the same coin.

Linux tends to show CIDR notation by default, while Windows sticks with dotted-decimal. It’s purely a display preference—your network stack treats them identically.

If you’re documenting your network, pick one format and stick with it. Mixing them up in notes or configs can lead to confusion. (Consistency is key here.)

What’s the difference between a subnet mask and a gateway?

A subnet mask defines your local network; a gateway is the door to the outside world. The mask determines which devices are on your local network, while the gateway routes traffic to other networks (like the internet).

Think of it like a neighborhood. Your subnet mask (e.g., 255.255.255.0) tells you which houses are on your street. The gateway (e.g., 192.168.1.1) is the road that leads out of your neighborhood to the highway.

Without a gateway, your devices can talk to each other but not the internet. Without a subnet mask, your router wouldn’t know which devices are local and which are remote. (Both are essential—don’t skip either.)

Can two devices have the same IP if they’re on different subnets?

Yes—IPs can overlap across subnets without conflict. The key is that the full network address (IP + subnet mask) must be unique.

For example, 192.168.1.100/24 and 192.168.2.100/24 can coexist peacefully. Routers treat them as separate networks, so there’s no conflict.

This is why larger networks use VLANs or multiple subnets—to avoid running out of addresses while keeping things organized. (It’s a neat trick for avoiding IP exhaustion.)

What happens if I set my mask to 255.255.0.0 on a /24 network?

You’ll accidentally expand your local network to include devices that shouldn’t be there. A /16 mask (255.255.0.0) treats 192.168.x.x as one big network, which can cause broadcast storms and routing issues.

Here’s what happens: Your device thinks every 192.168.x.x address is local. When it tries to send data to 192.168.2.50, it skips the router entirely—even if that device is on a different physical network. (This breaks things in subtle, hard-to-debug ways.)

Stick to the correct mask for your setup. If you’re on a /24, use 255.255.255.0. (Don’t overcomplicate it.)

How do I find the network address from an IP and mask?

Apply the subnet mask to the IP using a bitwise AND operation. The result is your network address.

For example, with IP 192.168.1.100 and mask 255.255.255.0, the network address is 192.168.1.0. (This is the base address for your subnet.)

Here’s how to do it manually:

  1. Convert the IP and mask to binary.
  2. Perform a bitwise AND (1 AND 1 = 1, everything else = 0).
  3. Convert the result back to decimal.

It sounds technical, but it’s just math. Most tools (like ipcalc) do this for you automatically.

Why do some routers use 255.255.255.254 as a mask?

A /31 mask (255.255.255.254) is used for point-to-point links, not typical LANs. It’s designed for two devices to share a subnet with no wasted addresses.

This is common in ISP or enterprise setups where two routers connect directly. For home networks? You’ll never see it. (It’s overkill for most use cases.)

If your router suddenly shows this mask, double-check your settings. It’s not something that should appear on a standard LAN.

What’s the smallest subnet I can use?

A /30 mask (255.255.255.252) gives you two usable host addresses. This is the smallest practical subnet for most networks.

Here’s the breakdown:

  • /30: 2 usable hosts (e.g., for a point-to-point link).
  • /31: 2 addresses, but no network/broadcast (used in special cases).
  • /32: 1 address (a single host, like a loopback or public IP).

For home networks, stick with /24 or larger. Smaller subnets are for pros only. (Don’t overcomplicate your setup.)

Ryan Foster
Author

Ryan Foster is a networking and cybersecurity writer with 12 years of experience as a network engineer. He's configured more routers than he can count and firmly believes that 90% of internet problems are DNS-related. He lives in Austin, TX.

How Is Probability Used In Weather Forecasting?How Do I Make Different Margins On Different Pages In Word?