| | |

LFCA 39 🐧 What is an IP Address

Every device on a network has an address. The address is how one device finds another, how the packets know where to go, and how the responses find their way back. On the internet and on the local networks that connect to it, that address is the IP address — a number that identifies a network interface. The IP address is not the same as the MAC address, which identifies the hardware; it is not the same as the hostname, which is a human-friendly name; and it is not permanent, because the address can change when the device moves or the lease expires. This chapter covers what an IP address is, the difference between IPv4 and IPv6, the structure of the address, the public and private ranges, the subnet mask and CIDR notation, the special addresses, and the tools for finding the current address. It is the foundation for the networking chapters that follow — routing, DNS, firewalls, and the diagnostics.

Key point: An IP address is a logical address assigned to a network interface. IPv4 addresses are 32 bits, written as four decimal octets (192.168.1.1). IPv6 addresses are 128 bits, written as eight hexadecimal groups (2001:db8::1). The address has two parts: the network portion and the host portion, separated by the subnet mask (or the CIDR prefix). The private IPv4 ranges — 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 — are not routable on the internet and are used on local networks. The special addresses include the loopback (127.0.0.1 and ::1), the link-local (169.254.0.0/16 and fe80::/10), and the multicast ranges. The ip addr command shows the current addresses.


What an IP address is

An IP address is a number assigned to a network interface. It has two purposes: identify the interface and locate it on the network. The two are related: the address says which network the device is on, and which host on that network it is.

The interface, not the device. A device can have several interfaces — a wired Ethernet, a wireless, a VPN tunnel — and each has its own IP address. The address identifies the interface, not the whole machine. A laptop with both a wired and a wireless connection has two addresses, one per interface.

The logical address. The IP address is logical, not physical. It is assigned by the network’s administrator or by the DHCP server, and it can change. The MAC address is the physical address, burned into the hardware, and it does not change. The two are separate, and the ARP protocol maps between them on the local network.

The address is not the name. A hostname like example.com is a human-friendly name that resolves to an IP address through DNS. The name is for people, and the address is for the machines. The two are separate, and the name can resolve to different addresses at different times.

Why the address is needed. The network’s routers use the address to forward the packets. The destination address tells the router which network the packet is for, and the router forwards it toward that network. The source address tells the recipient where to send the response.

Why the address is structured. The address has a network part and a host part. The network part identifies the network, and the host part identifies the interface on that network. The split is what makes the routing possible — the routers know the networks, not the individual hosts.

Why the address can change. A DHCP lease is for a limited time, and the address can change when the lease is renewed. A device that moves to a different network gets a different address. The address is a lease, not a property, and the applications should not depend on it being stable.

Why the address is not the port. The IP address identifies the device, and the port identifies the service on the device. The combination — 192.168.1.1:443 — identifies a specific service on a specific device. The address and the port are separate, and the two together are the socket.


The IPv4 address

IPv4 is the fourth version of the Internet Protocol, and it is the version that most of the internet still uses. Its addresses are 32 bits, written as four decimal octets separated by dots.

192.168.1.1

Each octet is a number from 0 to 255, and the four octets together are the 32-bit address. The address space is 2^32, which is about 4.3 billion addresses.

Why the dotted-decimal notation. The 32 bits are hard to read as a binary number, and the dotted-decimal notation is the human-friendly form. The four octets are the four bytes of the address, each written in decimal.

The binary form. The address in binary is 32 bits, and the dotted-decimal is the conversion. The address 192.168.1.1 is 11000000.10101000.00000001.00000001 in binary.

The address classes (historical). The original IPv4 design divided the addresses into classes — A, B, C, D, E — based on the first octet. Class A was 1.0.0.0 to 127.0.0.0, class B was 128.0.0.0 to 191.255.0.0, and class C was 192.0.0.0 to 223.255.255.0. The class system was replaced by CIDR in 1993, but the terms are still used informally.

Why the address space is exhausted. The 4.3 billion addresses were thought to be enough in the 1970s, but the growth of the internet exhausted them. The last blocks were allocated by IANA in 2011, and the regional registries have been allocating from the remaining pool since. The exhaustion is the reason for NAT and for the push to IPv6.

Why NAT exists. Network Address Translation allows a private network to share a single public address. The private addresses are not routable on the internet, and the NAT device translates them to the public address for the outgoing traffic. The translation is what allowed the internet to grow past the IPv4 limit, and it is why the private ranges exist.

Why the addresses are still used. IPv4 is still dominant because the change to IPv6 is slow. The two protocols coexist, and the devices often have both. The transition is the “dual stack” model, and it is the current state of the internet.

Why the address is 32 bits. The 32-bit address was chosen for the early ARPANET, where the number of hosts was small. The choice was reasonable for the time, and the exhaustion is the consequence.


The IPv6 address

IPv6 is the sixth version of the Internet Protocol, and it is the long-term replacement for IPv4. Its addresses are 128 bits, written as eight hexadecimal groups separated by colons.

2001:0db8:0000:0000:0000:0000:0000:0001

The eight groups are 16 bits each, and the address space is 2^128, which is about 340 undecillion addresses — effectively unlimited.

The compression rules. The leading zeros in each group can be omitted, and a single run of zero groups can be replaced with ::. The address above compresses to 2001:db8::1.

2001:db8::1

The :: can appear only once in an address, because the double colon is ambiguous if it appears twice.

Why the hexadecimal notation. The 128 bits are too many for the dotted-decimal notation, and the hexadecimal is more compact. The eight groups of four hex digits are the standard form, and the compression makes the common addresses short.

The IPv4-mapped addresses. An IPv6 address can embed an IPv4 address, which is the transition mechanism. The form is ::ffff:192.168.1.1.

The address types. The IPv6 addresses have types: the global unicast (2000::/3), the link-local (fe80::/10), the unique local (fc00::/7), and the multicast (ff00::/8). The types are the IPv6 equivalents of the IPv4 public, link-local, private, and multicast.

Why IPv6 is the future. The address space is effectively unlimited, which removes the need for NAT. The protocol has the built-in features — the stateless autoconfiguration, the mandatory IPsec, the simplified header — that the IPv4 does not. The adoption is growing, and the major networks and the mobile carriers are the leaders.

Why the transition is slow. The two protocols are not interoperable, and the devices have to support both. The dual-stack model runs both, and the tunneling carries the IPv6 over the IPv4. The transition has been in progress for decades, and it is still ongoing.

Why the address is 128 bits. The 128-bit address was chosen to be large enough that the exhaustion would not recur. The design is future-proof, and the cost is the larger header and the more complex notation.


The subnet mask and CIDR

The subnet mask separates the network part of the address from the host part. The CIDR notation is the modern way to express the mask.

The subnet mask. The mask is a 32-bit number with the network bits set to 1 and the host bits set to 0. The mask 255.255.255.0 means the first 24 bits are the network and the last 8 are the host.

192.168.1.1     = 11000000.10101000.00000001.00000001
255.255.255.0   = 11111111.11111111.11111111.00000000
                  └──────── network ────────┘└─ host ─┘

The CIDR notation. The Classless Inter-Domain Routing notation writes the mask as a prefix length. The mask 255.255.255.0 is /24, because the first 24 bits are the network.

192.168.1.1/24

Why the CIDR replaced the classes. The class system was rigid — a class A network had 16 million hosts, and a class C had 254. The CIDR allows any prefix length, which makes the allocation efficient. A network with 500 hosts can be a /23 (512 addresses) instead of a class B (65,534 addresses).

The common prefix lengths.

CIDRMaskAddressesHosts
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/24255.255.255.0256254
/25255.255.255.128128126
/30255.255.255.25242
/32255.255.255.25511

Why the host count is two less than the address count. The first address is the network address, and the last is the broadcast address. Neither can be assigned to a host. A /24 has 256 addresses, and 254 are usable.

The network address. The network address is the address with all the host bits set to 0. For 192.168.1.1/24, the network is 192.168.1.0.

The broadcast address. The broadcast address is the address with all the host bits set to 1. For 192.168.1.1/24, the broadcast is 192.168.1.255.

Why the split matters. The device uses the split to decide whether a destination is on the local network or on a remote network. The local destination is reached directly, and the remote destination is sent to the gateway. The decision is the routing, and the mask is the input.

Why the mask must be correct. A wrong mask causes the device to misclassify the destinations. A destination that is on the local network but is classified as remote is sent to the gateway, which may not route it back. A destination that is remote but is classified as local is sent to the local network, where no one answers. The mask is the correctness.


The private and public ranges

The IPv4 addresses are divided into the public addresses, which are routable on the internet, and the private addresses, which are not. The private ranges are used on the local networks, and the NAT translates them to the public address.

The private ranges (RFC 1918).

RangeCIDRAddresses
10.0.0.0 – 10.255.255.25510.0.0.0/816,777,216
172.16.0.0 – 172.31.255.255172.16.0.0/121,048,576
192.168.0.0 – 192.168.255.255192.168.0.0/1665,536

Why the private ranges exist. The ranges are reserved for the local networks, and the routers do not forward the traffic with the private addresses to the internet. The reservation is what allows the same address to be used on millions of networks without conflict, and the NAT is what translates the private address to the public.

The home network. A typical home network uses 192.168.1.0/24 or 192.168.0.0/24. The router has the address 192.168.1.1, and the devices have the addresses 192.168.1.2 through 192.168.1.254. The router’s public address is the one the ISP assigns, and the NAT translates.

The corporate network. A larger network uses the 10.0.0.0/8 range, which is divided into the subnets. The 10.0.0.0/8 is the largest private range, and it is the common choice for the enterprises.

The public addresses. The public addresses are the ones that are routable on the internet. They are allocated by the regional registries — ARIN, RIPE, APNIC, LACNIC, AFRINIC — and assigned to the ISPs and the organizations. A public address is globally unique, and it is the one the internet sees.

Why the public address is scarce. The IPv4 public addresses are exhausted, and the ISPs allocate them carefully. A residential connection often has a single public address, and the NAT shares it among the devices. A business connection may have a block of the public addresses, and the price reflects the scarcity.

Why the private address is not routable. The routers on the internet are configured to drop the traffic with the private addresses. The drop is the reason the private addresses are safe to reuse, and it is the reason the NAT is required for the internet access.

Why the IPv6 does not need the private ranges the same way. The IPv6 has the unique local addresses (fc00::/7), which are the private equivalent, but the global addresses are plentiful. The NAT is not required, and the devices can have the globally routable addresses. The model is different, and the transition is the reason the two coexist.


The special addresses

Some addresses have special meanings, and they are not assigned to the normal hosts.

The loopback. The 127.0.0.0/8 range is the loopback, and the 127.0.0.1 is the localhost. The traffic to the loopback does not leave the device, and it is used for the local services and the testing. The IPv6 equivalent is ::1.

The link-local. The 169.254.0.0/16 range is the IPv4 link-local, and the fe80::/10 is the IPv6 link-local. The addresses are self-assigned when the DHCP is not available, and they are valid only on the local link. The IPv4 link-local is the “APIPA” address, and it is the sign that the DHCP failed.

The multicast. The 224.0.0.0/4 range is the IPv4 multicast, and the ff00::/8 is the IPv6 multicast. The multicast addresses are for the one-to-many communication, and the 224.0.0.1 is the all-hosts multicast.

The broadcast. The 255.255.255.255 is the limited broadcast, and it is the address for the local network’s all-hosts. The directed broadcast — the network address with the host bits set to 1 — is the broadcast for a specific network.

The “this host” address. The 0.0.0.0 is the “this host” or “any” address. It is used by the services that listen on all the interfaces, and by the clients that do not yet have an address.

The documentation ranges. The 192.0.2.0/24, 198.51.100.0/24, and 203.0.113.0/24 are reserved for the documentation and the examples. The 2001:db8::/32 is the IPv6 equivalent. The ranges are used in the examples because they are not routable and cannot conflict with the real addresses.

Why the special addresses matter. The special addresses are the ones that appear in the configuration and the diagnostics. The loopback is the test, the link-local is the DHCP failure, the multicast is the discovery, and the documentation ranges are the examples. Knowing them is the fluency.

Why the documentation ranges are used in the examples. The examples in the documentation should not use the real addresses, because the reader might copy them. The reserved ranges are the safe choice, and the 192.0.2.0/24 is the common one.


Finding the current address

The ip addr command shows the current addresses. It is the modern replacement for the ifconfig command.

ip addr
# 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
#     inet 127.0.0.1/8 scope host lo
#     inet6 ::1/128 scope host
# 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP
#     inet 192.168.1.100/24 brd 192.168.1.255 scope global dynamic eth0
#     inet6 fe80::a00:27ff:fe4e:66a1/64 scope link

The output shows the interfaces, the addresses, the prefix lengths, the broadcast addresses, and the scopes. The lo is the loopback, and the eth0 is the first Ethernet.

The ip addr show <interface> form. The command with an interface shows only that interface.

ip addr show eth0

The ip -4 addr and ip -6 addr forms. The -4 shows only the IPv4, and the -6 shows only the IPv6.

ip -4 addr
ip -6 addr

The ip route command. The route shows the gateway and the routes.

ip route
# default via 192.168.1.1 dev eth0
# 192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.100

The default route is the gateway, and the 192.168.1.0/24 is the local network. The two are the essential routing.

The hostname -I command. The hostname -I shows the addresses in a single line.

hostname -I
# 192.168.1.100

The curl ifconfig.me command. The curl ifconfig.me shows the public address, which is the one the internet sees.

curl ifconfig.me
# 203.0.113.42

The public address is the one the ISP assigns, and it is often different from the local address because of the NAT.

The ip neigh command. The ip neigh shows the ARP table, which maps the IP addresses to the MAC addresses on the local network.

ip neigh
# 192.168.1.1 dev eth0 lladdr aa:bb:cc:dd:ee:ff REACHABLE

Why the ip command is preferred over the ifconfig. The ip command is the modern tool, and the ifconfig is the deprecated one. The ip has more features, and it is the one that is installed by default on the modern distributions. The ifconfig is the legacy, and it is available only when the net-tools package is installed.

Why the public address is not the same as the local. The NAT translates the local address to the public address, and the internet sees only the public. The local address is the one the device uses on the local network, and the public address is the one the ISP assigns. The two are different, and the curl ifconfig.me shows the public.


Complete Example Session

# ============================================
# PART 1: SHOW THE ADDRESSES
# ============================================

ip addr
# 1: lo: <LOOPBACK,UP,LOWER_UP>
#     inet 127.0.0.1/8 scope host lo
#     inet6 ::1/128 scope host
# 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP>
#     inet 192.168.1.100/24 brd 192.168.1.255 scope global dynamic eth0
#     inet6 fe80::a00:27ff:fe4e:66a1/64 scope link

# ============================================
# PART 2: THE SPECIFIC INTERFACE
# ============================================

ip addr show eth0

# ============================================
# PART 3: THE IPV4 ONLY
# ============================================

ip -4 addr
# 1: lo: ...
#     inet 127.0.0.1/8 scope host lo
# 2: eth0: ...
#     inet 192.168.1.100/24 brd 192.168.1.255 scope global dynamic eth0

# ============================================
# PART 4: THE ROUTES
# ============================================

ip route
# default via 192.168.1.1 dev eth0
# 192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.100

# ============================================
# PART 5: THE ADDRESSES IN ONE LINE
# ============================================

hostname -I
# 192.168.1.100

# ============================================
# PART 6: THE PUBLIC ADDRESS
# ============================================

curl ifconfig.me
# 203.0.113.42

# ============================================
# PART 7: THE ARP TABLE
# ============================================

ip neigh
# 192.168.1.1 dev eth0 lladdr aa:bb:cc:dd:ee:ff REACHABLE

# ============================================
# PART 8: THE ADDRESS STRUCTURE
# ============================================

# 192.168.1.100/24
#   │       │   │
#   │       │   └── the prefix length (24 bits)
#   │       └── the host part (100)
#   └── the network part (192.168.1)

# The network:    192.168.1.0
# The broadcast:  192.168.1.255
# The host range: 192.168.1.1 – 192.168.1.254

# ============================================
# PART 9: THE PRIVATE RANGES
# ============================================

# 10.0.0.0/8         — 16M addresses
# 172.16.0.0/12      — 1M addresses
# 192.168.0.0/16     — 65K addresses

# The local address 192.168.1.100 is in the 192.168.0.0/16 range.
# It is not routable on the internet.
# The NAT translates it to the public address.

# ============================================
# PART 10: THE SPECIAL ADDRESSES
# ============================================

# 127.0.0.1     — the loopback
# 169.254.x.x   — the link-local (APIPA)
# 224.0.0.1     — the all-hosts multicast
# 255.255.255.255 — the limited broadcast
# 0.0.0.0       — the "any" address
# 192.0.2.0/24  — the documentation range

# ============================================
# PART 11: WHAT NOT TO DO
# ============================================

# Don't assume the local address is the public
# The NAT translates. Use curl ifconfig.me for the public.

# Don't use the ifconfig command on the modern systems
# Use the ip command.

# Don't assume the private address is routable
# The routers drop the private traffic.

# Don't use the real addresses in the documentation
# Use the 192.0.2.0/24 range.

# Don't assume the address is permanent
# The DHCP lease can change.

# Don't ignore the prefix length
# The /24 and the /16 are different networks.

The eleven parts cover the addresses, the specific interface, the IPv4 filter, the routes, the one-line, the public address, the ARP table, the structure, the private ranges, the special addresses, and the anti-patterns.


Quick Reference

The IPv4 and IPv6

AspectIPv4IPv6
Size32 bits128 bits
NotationDotted decimalHex groups
Example192.168.1.12001:db8::1
Address space4.3 billion340 undecillion
NATCommonNot needed
HeaderVariableFixed

The Private Ranges (RFC 1918)

RangeCIDRAddresses
10.0.0.0 – 10.255.255.25510.0.0.0/816,777,216
172.16.0.0 – 172.31.255.255172.16.0.0/121,048,576
192.168.0.0 – 192.168.255.255192.168.0.0/1665,536

The Common Prefix Lengths

CIDRMaskAddressesHosts
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/24255.255.255.0256254
/30255.255.255.25242

The Special Addresses

AddressPurpose
127.0.0.1The loopback
::1The IPv6 loopback
169.254.0.0/16The IPv4 link-local
fe80::/10The IPv6 link-local
224.0.0.0/4The IPv4 multicast
ff00::/8The IPv6 multicast
255.255.255.255The limited broadcast
0.0.0.0The “any” address
192.0.2.0/24The documentation

The Commands

CommandPurpose
ip addrShow the addresses
ip addr show <if>Show one interface
ip -4 addrIPv4 only
ip -6 addrIPv6 only
ip routeShow the routes
ip neighShow the ARP table
hostname -IThe addresses in one line
curl ifconfig.meThe public address

Best Practices

✅ Do This:

# Use ip addr for the current addresses
ip addr                                                       # ✅

# Check the prefix length
ip -4 addr show eth0                                          # ✅

# Check the routes
ip route                                                      # ✅

# Check the public address
curl ifconfig.me                                              # ✅

# Use the private ranges on the local networks
192.168.1.0/24                                                # ✅

# Use the documentation ranges in the examples
192.0.2.0/24                                                  # ✅

# Check the ARP table for the local neighbors
ip neigh                                                      # ✅

❌ Don’t Do This:

# Don't assume the local address is the public
# The NAT translates. Use curl ifconfig.me.                 # ⚠️

# Don't use ifconfig on the modern systems
ifconfig  # use ip                                           # ⚠️

# Don't use the real addresses in the documentation
# Use 192.0.2.0/24.                                          # ⚠️

# Don't assume the private address is routable
# The routers drop it.                                       # ⚠️

# Don't assume the address is permanent
# The DHCP lease can change.                                 # ⚠️

# Don't ignore the prefix length
# /24 and /16 are different networks.                        # ⚠️

Common Pitfalls

PitfallProblemSolution
Local assumed publicThe NAT hides itcurl ifconfig.me
ifconfig usedDeprecatedUse ip
Private used in the exampleMisleadingUse 192.0.2.0/24
Prefix length ignoredWrong networkCheck the CIDR
Address assumed permanentThe lease changesUse the hostname or DNS
Link-local mistakenThe DHCP failedCheck the DHCP
Loopback confusedThe local onlyThe 127.0.0.1 is the local

Real-World Examples

1. Show the addresses

ip addr

2. Show one interface

ip addr show eth0

3. IPv4 only

ip -4 addr

4. The routes

ip route

5. The addresses in one line

hostname -I

6. The public address

curl ifconfig.me

7. The ARP table

ip neigh

8. The private range

192.168.1.0/24

9. The documentation range

192.0.2.0/24

10. The loopback

127.0.0.1

Visual: The Address Structure

┌──────────────────────────────────────────────────────────┐
│  192.168.1.100/24                                        │
│    │       │   │                                         │
│    │       │   └── the prefix length: 24 bits            │
│    │       └── the host part: 100                        │
│    └── the network part: 192.168.1                       │
│                                                          │
│  The network address:   192.168.1.0                      │
│  The first host:        192.168.1.1                      │
│  The last host:         192.168.1.254                    │
│  The broadcast:         192.168.1.255                    │
│                                                          │
│  The network and the broadcast are not assignable.       │
│  254 hosts are usable in a /24.                          │
│                                                          │
└──────────────────────────────────────────────────────────┘

Visual: The IPv4 and the IPv6

┌──────────────────────────────────────────────────────────┐
│  IPv4                                                    │
│    32 bits, dotted decimal                               │
│    192.168.1.1                                           │
│                                                          │
│    ┌─────────┬─────────┬─────────┬─────────┐             │
│    │  192    │  168    │    1    │    1    │             │
│    └─────────┴─────────┴─────────┴─────────┘             │
│     Each octet: 0–255 (8 bits)                           │
│                                                          │
├──────────────────────────────────────────────────────────┤
│  IPv6                                                    │
│    128 bits, hexadecimal groups                          │
│    2001:0db8:0000:0000:0000:0000:0000:0001               │
│    Compressed: 2001:db8::1                               │
│                                                          │
│    ┌──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┐│
│    │ 2001 │ 0db8 │  0   │  0   │  0   │  0   │  0   │  1  ││
│    └──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┘│
│     Each group: 0–ffff (16 bits)                         │
│                                                          │
└──────────────────────────────────────────────────────────┘

Visual: The Private Ranges

┌──────────────────────────────────────────────────────────┐
│  10.0.0.0/8                                              │
│    The largest private range.                            │
│    16,777,216 addresses.                                 │
│    Common in the enterprises.                            │
│                                                          │
├──────────────────────────────────────────────────────────┤
│  172.16.0.0/12                                           │
│    1,048,576 addresses.                                  │
│    Common in the medium networks.                        │
│                                                          │
├──────────────────────────────────────────────────────────┤
│  192.168.0.0/16                                          │
│    65,536 addresses.                                     │
│    Common in the homes and the small offices.            │
│                                                          │
├──────────────────────────────────────────────────────────┤
│  THE NAT TRANSLATES                                      │
│                                                          │
│  The private address   →  the public address             │
│  192.168.1.100         →  203.0.113.42                   │
│                                                          │
│  The internet sees only the public address.              │
│                                                          │
└──────────────────────────────────────────────────────────┘

Visual: The CIDR

┌──────────────────────────────────────────────────────────┐
│  /24                                                     │
│  Network: 192.168.1.0                                    │
│  Hosts:   192.168.1.1 – 192.168.1.254                    │
│  Broadcast: 192.168.1.255                                │
│  254 usable addresses.                                   │
│                                                          │
├──────────────────────────────────────────────────────────┤
│  /16                                                     │
│  Network: 192.168.0.0                                    │
│  Hosts:   192.168.0.1 – 192.168.255.254                  │
│  Broadcast: 192.168.255.255                              │
│  65,534 usable addresses.                                │
│                                                          │
├──────────────────────────────────────────────────────────┤
│  /30                                                     │
│  Network: 192.168.1.0                                    │
│  Hosts:   192.168.1.1 – 192.168.1.2                      │
│  Broadcast: 192.168.1.3                                  │
│  2 usable addresses.                                     │
│  Common for the point-to-point links.                    │
│                                                          │
└──────────────────────────────────────────────────────────┘

Visual: The Special Addresses

┌──────────────────────────────────────────────────────────┐
│  127.0.0.1                                               │
│    The loopback. The traffic stays on the device.        │
│    The IPv6 equivalent: ::1                              │
│                                                          │
├──────────────────────────────────────────────────────────┤
│  169.254.0.0/16                                          │
│    The IPv4 link-local. Self-assigned when the DHCP      │
│    fails. The sign of a DHCP problem.                    │
│                                                          │
├──────────────────────────────────────────────────────────┤
│  224.0.0.0/4                                             │
│    The IPv4 multicast. One-to-many.                      │
│    224.0.0.1 is the all-hosts.                           │
│                                                          │
├──────────────────────────────────────────────────────────┤
│  255.255.255.255                                         │
│    The limited broadcast. The local network's all-hosts. │
│                                                          │
├──────────────────────────────────────────────────────────┤
│  0.0.0.0                                                 │
│    The "any" address. The services listen on it.         │
│                                                          │
├──────────────────────────────────────────────────────────┤
│  192.0.2.0/24                                            │
│    The documentation range. For the examples.            │
│                                                          │
└──────────────────────────────────────────────────────────┘

Summary

ItemValue
IPv432 bits, dotted decimal
IPv6128 bits, hex groups
Network partThe prefix
Host partThe suffix
CIDRThe prefix length
Private ranges10/8, 172.16/12, 192.168/16
Loopback127.0.0.1, ::1
Link-local169.254/16, fe80::/10
Multicast224/4, ff00::/8
Documentation192.0.2.0/24
CommandPurpose
ip addrThe addresses
ip routeThe routes
ip neighThe ARP table
hostname -IThe addresses in one line
curl ifconfig.meThe public address

Key takeaways:

  • An IP address is a logical address assigned to a network interface — it identifies the interface and locates it on the network, and it is separate from the MAC address and the hostname
  • IPv4 addresses are 32 bits in dotted-decimal notation — the address space is exhausted, and NAT and the private ranges are the workarounds
  • IPv6 addresses are 128 bits in hexadecimal groups — the space is effectively unlimited, the compression rules make the addresses short, and the adoption is growing
  • The subnet mask and the CIDR separate the network part from the host part — the /24 is the prefix length, and the split determines the local versus the remote
  • The private ranges are not routable on the internet — 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 are the RFC 1918 ranges, and the NAT translates them to the public address
  • The special addresses have the special meanings — the loopback, the link-local, the multicast, the broadcast, the “any,” and the documentation ranges
  • The ip addr command shows the current addresses — it is the modern replacement for the ifconfig, and the -4 and -6 flags filter the families
  • The ip route command shows the gateway and the routes — the default route is the gateway, and the local network route is the direct
  • The public address is not the local address — the NAT translates, and the curl ifconfig.me shows the public
  • The documentation ranges are used in the examples — 192.0.2.0/24 and its siblings are reserved, and they cannot conflict with the real addresses

Remember: An IP address is the logical address that identifies a network interface and locates it on the network. The IPv4 is the 32-bit dotted decimal, the IPv6 is the 128-bit hexadecimal, and the two coexist. The subnet mask separates the network from the host, the private ranges are for the local networks, and the NAT translates to the public. The ip addr shows the current address, the ip route shows the gateway, and the curl ifconfig.me shows the public. The address is the foundation of the networking, and everything else builds on it.


Stop using slow, ad-bloated tool sites! 🤮

🔎 Search “KandZ Tools” on Google to use many professional utilities for free.

KandZ.me is the ultimate minimalist hub for:
✅ Finance (Mortgage, Interest, Inflation)
✅ Tech (Base64, JSON, Dev Suite, IP)
✅ Health (BMI, BMR, TDEE)
✅ Productivity (Timer, Workspace, QR)

⚡️ Fast & Private
🔒 No data leaves your device
💎 100% Free

🔗 Use it now: https://tools.kandz.me
🔖 Bookmark it—you’ll need it later!