Beginner 6 min read

๐ŸŒ What Is an IP Address? IPv4 vs IPv6 Explained

๐Ÿ“˜ What You Will Learn

  • What an IP address is and why it exists
  • IPv4 vs IPv6 (and why we need both)
  • Public vs private IP addresses
  • How your router shares one public IP
  • How to find your IP on Windows and Linux
  • How to test a connection with ping
  • How to fix the most common IP errors

๐Ÿง  What Is an IP Address?

An IP address is a unique number given to every device on a network.

IP = Internet Protocol.

It helps devices:

  • Find each other
  • Send data
  • Receive data

๐Ÿ‘‰ It works at the Network Layer

Simple meaning:

Device A  <-->  Internet  <-->  Device B
(IP: A)                         (IP: B)

There are two versions:

  • IPv4 (the old one, still everywhere)
  • IPv6 (the new one, built to replace it)

๐Ÿ“ฆ Easy Analogy

You want to send a letter to a friend.

No house address = the post office cannot deliver it.

Every phone, laptop and website needs an address too. That address is called an IP address.

Your friend's house   =  Your device
House address         =  IP address
Post office           =  The internet (routers)
Letter                =  Your data

๐Ÿค” Why Do We Need IP Addresses?

Data on the internet travels in small pieces called packets.

Each packet needs two things:

  • Where it came from
  • Where it is going

The IP address is that "from" and "to" label.

Your laptop                                   Website server
192.168.1.10  ---> [Router] ---> Internet ---> 93.184.216.34
   (from)                                          (to)

No address, no delivery. Simple.


1๏ธโƒฃ IPv4: The Classic Address

Four numbers, separated by dots. Each number is between 0 and 255.

192.168.1.10

Why 0 to 255? Each number is stored in 8 bits. Four numbers x 8 bits = 32 bits in total.

Total possible addresses: 2^32 = 4,294,967,296 (about 4.3 billion).

โš ๏ธ The world has more devices than that. Phones, laptops, TVs, cameras, servers... we ran out.


2๏ธโƒฃ IPv6: The Fix

IPv6 was created to solve the shortage.

It uses numbers and letters (hexadecimal, meaning digits 0-9 plus letters a-f), separated by colons.

2001:db8::1

The :: is a shortcut for a long run of zeros.

Short form :  2001:db8::1
Full form  :  2001:0db8:0000:0000:0000:0000:0000:0001

IPv6 uses 128 bits. Total addresses: 2^128, about 3.4 x 10^38.

That is so many, we will not run out.


โš–๏ธ IPv4 vs IPv6

IPv4 IPv6
Looks like 192.168.1.10 2001:db8::1
Size 32 bits 128 bits
Written in Decimal numbers Hexadecimal
Separator Dot . Colon :
Total addresses About 4.3 billion About 3.4 x 10^38
Status Still the most used Growing every year

Both run side by side today. Most devices have an IPv4 and an IPv6 address at the same time.


๐Ÿ  Public vs Private IP

Not every address is visible on the internet.

Public IP Your address on the internet. Your ISP (internet provider) gives it to you. Websites see this one.

Private IP Your device's address inside your home network. Only devices in your home can use it.

These ranges are always private (IPv4):

Range Common use
10.0.0.0 to 10.255.255.255 Big networks, offices
172.16.0.0 to 172.31.255.255 Mid-size networks
192.168.0.0 to 192.168.255.255 Home Wi-Fi routers

Two special addresses to remember:

Address Meaning
127.0.0.1 (IPv6: ::1) localhost: your own device talking to itself
169.254.x.x Self-assigned. Something went wrong (see errors below)

๐Ÿ”€ How One Public IP Serves Your Whole Home

Your home has many devices. Your ISP gives you only one public IP.

Your router handles this. The trick is called NAT (Network Address Translation).

Think of an office reception desk. One phone number for the company, and reception forwards each call to the right desk.

Phone      192.168.1.10  --\
Laptop     192.168.1.11  ---+--> [ ROUTER ] --> Internet
Smart TV   192.168.1.12  --/      one public IP
                                  (example: 203.0.113.5)

Websites see only the router's public IP. They never see your private 192.168.x.x.

๐Ÿ’ก Your public IP can change. Most home ISPs give a dynamic IP, which may change when your router restarts.


๐Ÿ” Find Your Own IP Address

Windows

Open Command Prompt and run:

ipconfig

Look under your active adapter (Wi-Fi or Ethernet).

Sample output (yours will differ):

Wireless LAN adapter Wi-Fi:
   IPv6 Address. . . . : 2001:db8::1a2b
   IPv4 Address. . . . : 192.168.1.10

Linux

Open Terminal and run:

ip addr

Look for the inet line (IPv4) and the inet6 line (IPv6).

Sample output (yours will differ):

2: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP>
    inet 192.168.1.10/24 brd 192.168.1.255 scope global wlan0
    inet6 2001:db8::1a2b/64 scope global

Ignore lo (that is localhost, 127.0.0.1).

Find your PUBLIC IP (Windows and Linux)

curl ifconfig.me

This shows the address websites see, not the one from ipconfig.


๐Ÿ“ก Test the Connection with ping

ping sends a tiny message to an address and waits for a reply. If replies come back, the path works.

Windows (stops by itself after 4 replies):

ping 8.8.8.8

Linux (never stops on its own, so limit it):

ping -c 4 8.8.8.8

Or press Ctrl + C to stop it.

8.8.8.8 is Google's public DNS server. It is a safe address to test with.


โŒ Common Errors & Solutions

Error / Symptom Cause Fix
IP starts with 169.254 Device asked the router for an address and got no answer (self-assigned) Restart the router, reconnect to Wi-Fi
Request timed out after ping Network is down, or replies are blocked Check your internet connection first
Thinking 192.168.x.x is visible online It is a private address Only your public IP is seen online
ipconfig IP differs from "what is my IP" site Router shares one public IP (NAT) This is normal. See the NAT section
Public IP changed by itself ISP gave a dynamic IP Normal for home internet

๐Ÿ’ก Pro Tip

Your router shares one public IP among all your home devices.

That is why a "what is my IP" website shows a different address than ipconfig.

Two different addresses. Both are correct.


๐ŸŽฏ Final Summary

- An IP address is a device's address on a network
- IPv4: four numbers with dots (32 bits, ~4.3 billion addresses)
- IPv6: hexadecimal with colons (128 bits, almost endless)
- Public IP = your address on the internet
- Private IP = your address inside your home network
- Router shares one public IP using NAT
- Windows: ipconfig | Linux: ip addr | Public IP: curl ifconfig.me
- Test with ping (Linux: ping -c 4)

๐Ÿ“Œ Next Tutorial

IP, Subnet, CIDR & MAC: how networks are split up, what /24 means, and how MAC addresses fit in.


TechWithJuned ยท Learn โ†’ Execute โ†’ Build

๐Ÿ’ฌ Questions & Discussion

Have a doubt? Ask below โ€” no login needed.

Loading comments...