IP Addressing Explained for Beginners

Understand IPv4 addresses, subnet masks, public vs private IPs, and CIDR notation with visual diagrams and practical examples.

IP addressing diagram showing network and host portions of an IPv4 address
📧

Get weekly IT guides

Join 5,000+ IT professionals

Subscribe Free

Every device on the internet has an address. Your phone, your laptop, Google’s servers — all of them. Without IP addresses, data would have no idea where to go. It would be like mailing a letter with no address on the envelope.

Yet most people have never looked at theirs. Let’s change that.

Introduction

What You'll Learn
  • What an IP address is and how it works
  • The difference between public and private IPs
  • How subnet masks divide networks
  • CIDR notation (the /24 you keep seeing)
  • IPv4 vs IPv6: why we’re running out
Mental Model: The Street Address System

An IP address works like a street address.

  • Network portion = The city name (identifies which network you’re on)
  • Host portion = The house number (identifies your specific device on that network)

Just like “42 Oak Street, Springfield” tells the postman the city AND the exact house, 192.168.1.42 tells routers the network AND the specific device.

Anatomy of an IPv4 Address

An IPv4 address is a 32-bit number, written as 4 groups of 8 bits (0-255), separated by dots.

IPv4 Address Structure showing Network and Host portions
IPv4 Address Structure (32 bits)
Binary Breakdown

Computers see 1s and 0s.

  • 192.168.1 (24 bits) → 11000000.10101000.00000001
  • 42 (8 bits) → 00101010
Key Rule

Every IP address has two parts: Network (which network?) and Host (which device on that network?). The subnet mask determines where one ends and the other begins.


Finding Your IP Address

ip addr show

Display all network interfaces and their IP addresses (Linux)

beginner
ip addr show eth0
  • Look for 'inet' followed by your IP
  • On Windows use: ipconfig
  • On macOS use: ifconfig
curl ifconfig.me

Find your public IP address (the one the internet sees)

beginner
curl ifconfig.me
203.0.113.42
  • This shows your PUBLIC IP
  • ip addr shows your PRIVATE IP
  • They are different! (NAT makes this possible)

Public vs. Private IP Addresses

Not all IP addresses are created equal. Some are for the public internet, others are for your local network only.

Public vs Private IP addresses connected via Router NAT
Public vs Private IPs (NAT)

Reserved Private IP Ranges

RangeCIDRTypical Use
10.0.0.010.255.255.25510.0.0.0/8Large enterprises, cloud VPCs
172.16.0.0172.31.255.255172.16.0.0/12Medium organizations
192.168.0.0192.168.255.255192.168.0.0/16Home networks, small offices
Why Private IPs Exist

There are only ~4.3 billion IPv4 addresses (2³²). That’s not enough for every device on Earth. Private IPs let millions of networks reuse the same address ranges internally, and NAT handles the translation to the public internet.


Subnet Masks: Dividing the Address

The subnet mask tells the system which bits are the network and which are the host.

Subnet MaskCIDRNetwork BitsHost BitsUsable Hosts
255.0.0.0/882416,777,214
255.255.0.0/16161665,534
255.255.255.0/24248254
255.255.255.128/25257126
255.255.255.192/2626662
Subnet Mask AND operation logic
How Subnet Masks Work (The AND Operation)

Reading a /24 Network

IP:     192.168.1.42
Mask:   255.255.255.0  (/24)

Network: 192.168.1.0    ← The "street" (first 24 bits)
Host:    .42             ← The "house" (last 8 bits)
Range:   192.168.1.1 to 192.168.1.254  (254 usable)
Quick Rule

/24 = 254 hosts. This is the most common subnet for home and small office networks. When someone says “a /24 network,” they mean a block of 254 usable addresses.


CIDR Notation

CIDR (Classless Inter-Domain Routing) is the modern way to express IP ranges. Instead of writing the full subnet mask, you write a slash followed by the number of network bits.

Full FormCIDR
192.168.1.0 with mask 255.255.255.0192.168.1.0/24
10.0.0.0 with mask 255.0.0.010.0.0.0/8
172.16.0.0 with mask 255.255.240.0172.16.0.0/20

The number after / = how many bits are used for the network. The remaining bits = hosts.


Special IP Addresses

AddressPurpose
127.0.0.1Loopback — your own machine (“localhost”)
0.0.0.0”All interfaces” / “any address” (used in server configs)
255.255.255.255Broadcast — sends to all devices on the network
169.254.x.xAPIPA — auto-assigned when DHCP fails
8.8.8.8Google’s Public DNS server
ping 127.0.0.1

Ping yourself (loopback test). If this fails, your network stack is broken.

beginner
ping -c 4 127.0.0.1
  • This tests your local TCP/IP stack
  • If this fails, reinstall network drivers

IPv4 vs IPv6

FeatureIPv4IPv6
Address size32 bits128 bits
Total addresses~4.3 billion~340 undecillion (3.4 × 10³⁸)
Format192.168.1.12001:0db8:85a3::8a2e:0370:7334
NAT needed?Yes (not enough addresses)No (every device gets a unique public IP)
AdoptionUniversal~45% of global traffic (2026)
Why IPv6 Adoption Is Slow

IPv6 has been available since 1998, but adoption is slow because NAT “solved” the IPv4 shortage for most use cases. The transition is gradual — both protocols coexist today (dual-stack).


Troubleshooting IP Issues

ProblemCheckCommand
No internetDo you have an IP?ip addr show (look for inet)
169.254.x.x addressDHCP server is unreachableRestart router or check DHCP config
Can’t reach other devicesSame subnet?Compare network portions of both IPs
Can reach local, not internetDefault gateway issueip route show (check default route)
ip route show

Display the routing table (shows your default gateway)

beginner
ip route show
  • Look for 'default via X.X.X.X' — that's your router
  • On Windows: route print

Quiz: Test Your Knowledge

🧠

Test Your Knowledge

Take a quick 4-question quiz to check your understanding.


Key Takeaways

  1. Every device needs an IP — it’s the unique address that makes internet routing possible.
  2. Network + Host — the subnet mask splits the address into “which network” and “which device.”
  3. Public vs. Private — private IPs (192.168.x.x, 10.x.x.x) are for local networks; NAT bridges them to the public internet.
  4. CIDR (/24, /16) is the modern way to express network sizes.
  5. IPv6 is coming — 128-bit addresses solve the scarcity problem, but adoption is gradual.
What's Next?

Deepen your networking knowledge:

📧

Get weekly IT guides

Join 5,000+ IT professionals

Subscribe Free
Type to start searching...