IP Address — The Logical Address of a Network Device¶
Every device connected to a network requires a unique IP (Internet Protocol) Address to communicate with other devices. Just as a postal address helps deliver letters to the correct house, an IP address enables network devices to send and receive data across local networks and the Internet. Whether you're browsing a website, accessing cloud services, connecting to a Kubernetes cluster, or managing Linux servers, IP addressing is the foundation of all network communication. Every Linux administrator, DevOps engineer, Cloud Architect, Platform Engineer, Site Reliability Engineer (SRE), and Network Engineer must understand IP addressing.
Learning Path¶
Course Progress
What You'll Learn¶
After completing this lesson, you'll be able to:
- Understand what an IP Address is
- Differentiate between IPv4 and IPv6
- Understand public and private IP addresses
- Explain static and dynamic IP addressing
- Identify network and host portions
- Understand how devices communicate using IP addresses
- View and troubleshoot IP configuration in Linux
Prerequisites¶
Complete:
- What is Networking?
- Types of Networks
- Network Topologies
- OSI Model
- TCP/IP Model
- Data Encapsulation
- MAC Address
Why Learn IP Addresses?¶
Imagine sending a parcel without a destination address.
The courier would never know where to deliver it.
Similarly, without an IP address:
- Computers cannot communicate.
- Routers cannot forward packets.
- Websites cannot be accessed.
- Cloud services become unreachable.
Every network communication depends on IP addressing.
What is an IP Address?¶
An IP Address (Internet Protocol Address) is a logical address assigned to a network device.
It uniquely identifies a device on a network and enables communication between devices.
Unlike Media Access Control (MAC) addresses, IP addresses can change depending on the network configuration.
Real-Life Analogy¶
Think of:
- MAC Address → Fingerprint
- IP Address → Home Address
Your fingerprint identifies you.
Your home address tells others where to find you.
Similarly:
- MAC identifies the device.
- IP identifies the device's network location.
Why Do Devices Need IP Addresses?¶
IP addresses allow devices to:
- Send data
- Receive data
- Identify remote devices
- Communicate across different networks
- Access the Internet
Without IP addresses, routers would not know where to forward packets.
IPv4 and IPv6¶
There are two versions of IP currently in use.
| Version | Address Length |
|---|---|
| IPv4 | 32-bit |
| IPv6 | 128-bit |
IPv4 remains the most widely deployed, while IPv6 is increasingly adopted due to IPv4 address exhaustion.
IPv4 Address¶
An IPv4 address contains 32 bits divided into four octets.
Example:
Each octet ranges from:
Another example:
IPv4 Structure¶
Total:
IPv6 Address¶
An IPv6 address contains 128 bits represented in hexadecimal.
Example:
Compressed representation:
IPv6 supports an enormous address space.
Logical Address¶
Unlike a MAC address, an IP address can change.
Examples:
Home Wi-Fi:
Office Wi-Fi:
Cloud VM:
The same device may receive different IP addresses on different networks.
Public IP Address¶
A Public IP Address is globally unique and reachable over the Internet.
Example:
Public IPs are assigned by Internet Service Providers (ISPs) or cloud providers.
Used by:
- Websites
- Cloud servers
- Internet-facing services
Private IP Address¶
Private IP addresses are used within internal networks and are not directly routable on the Internet.
Private IPv4 ranges:
Examples:
Public vs Private IP¶
| Public IP | Private IP |
|---|---|
| Internet Routable | Local Network Only |
| Globally Unique | Reusable |
| Assigned by ISP/Cloud | Assigned by Local Network |
| Accessible from Internet | Protected Behind NAT |
Static IP Address¶
A Static IP Address remains the same until it is manually changed.
Commonly used for:
- Servers
- Routers
- Firewalls
- Domain Name System (DNS) Servers
- Kubernetes Control Plane Nodes
Advantages:
- Predictable
- Reliable
- Easy to manage
Dynamic IP Address¶
A Dynamic IP Address is assigned automatically by a Dynamic Host Configuration Protocol (DHCP) server.
Commonly used for:
- Laptops
- Smartphones
- Tablets
- Home devices
Advantages:
- Automatic configuration
- Efficient address management
Network and Host Portions¶
Every IP address consists of:
- Network Portion
- Host Portion
Example:
Network:
Host:
The subnet mask determines where the network ends and the host begins.
How Communication Works¶
Suppose:
Laptop:
Server:
Communication:
Both devices communicate directly because they belong to the same network.
Different Networks¶
Suppose:
Laptop:
Web Server:
Communication:
The router forwards packets between networks.
IP Address Assignment¶
Devices obtain IP addresses through:
- Static configuration
- DHCP
- Cloud automation
- Kubernetes networking
We'll explore DHCP in detail later in the course.
Viewing IP Addresses in Linux¶
Display IP addresses.
Display routing table.
Display interface details.
Traditional command:
DNS and IP Addresses¶
Humans prefer names.
Example:
Computers use IP addresses.
Example:
DNS translates domain names into IP addresses.
IP Address vs MAC Address¶
| IP Address | MAC Address |
|---|---|
| Layer 3 | Layer 2 |
| Logical Address | Physical Address |
| Can Change | Usually Permanent |
| Used by Routers | Used by Switches |
| Internet Communication | Local Network Communication |
Production Perspective¶
IP addressing is used in:
- Enterprise Networks
- Kubernetes Clusters
- Cloud Virtual Private Clouds (VPCs)
- Load Balancers
- Firewalls
- Virtual Private Networks (VPNs)
- Virtual Machines
- Containers
Every production environment relies on proper IP address planning.
Cloud Perspective¶
Cloud platforms assign IP addresses to:
- Virtual Machines
- Kubernetes Nodes
- Load Balancers
- Databases
- Storage Services
Examples:
- AWS Elastic IP
- Azure Public IP
- Google Cloud External IP
Cloud networking is built around IP communication.
Kubernetes Perspective¶
Every Kubernetes object communicates using IP addresses.
Examples:
- Pods
- Nodes
- Services
- Ingress Controllers
Kubernetes automatically manages IP allocation within the cluster.
Hands-on Lab¶
Task 1¶
Display IP addresses.
Task 2¶
Display routing table.
Task 3¶
Display network interfaces.
Task 4¶
Test connectivity.
Task 5¶
Display your public IP address.
Task 6¶
Identify whether your local IP address is public or private.
Task 7¶
Determine the network and host portions of the following address:
Task 8¶
Create a simple network diagram containing:
- Laptop
- Switch
- Router
- Internet
- Web Server
Label the IP address used at each stage and explain how the packet reaches the destination.
Linux Commands¶
| Command | Purpose |
|---|---|
ip addr | Display IP addresses |
ip route | Display routing table |
ip link | Display interfaces |
ping | Test connectivity |
hostname -I | Display assigned IP addresses |
curl ifconfig.me | Display public IP address |
Common Mistakes¶
❌ Confusing MAC and IP addresses.
✅ MAC identifies the device; IP identifies its network location.
❌ Assuming private IPs work directly on the Internet.
✅ Private IPs require Network Address Translation (NAT) to access the Internet.
❌ Believing static IPs never change automatically.
✅ They remain fixed only until manually modified.
❌ Ignoring subnet information.
✅ Always consider the subnet when determining communication.
❌ Assuming DNS replaces IP addresses.
✅ DNS translates names into IP addresses; communication still uses IPs.
Best Practices¶
- Use static IPs for servers and infrastructure devices.
- Use DHCP for client devices where appropriate.
- Document IP address assignments.
- Avoid IP address conflicts.
- Plan IP address allocation before deploying large environments.
- Understand the difference between public and private IP addresses.
Interview Questions¶
Beginner¶
- What is an IP address?
- What is the difference between IPv4 and IPv6?
- What is the difference between a public and private IP address?
- Why do devices need IP addresses?
Intermediate¶
- Compare static and dynamic IP addressing.
- Explain the difference between MAC and IP addresses.
- What happens when two devices are on different networks?
- How does DNS relate to IP addresses?
Architect Level¶
- How would you design an IP addressing scheme for a large enterprise?
- Explain IP address management in cloud environments.
- How does Kubernetes allocate IP addresses to Pods and Services?
Summary¶
In this lesson, you learned:
- What an IP Address is
- IPv4 and IPv6
- Public and private IP addresses
- Static and dynamic IP assignment
- Network and host portions
- IP communication
- Linux commands for viewing IP configuration
- Cloud and Kubernetes IP addressing
IP addresses provide the logical foundation of networking. While MAC addresses identify devices within a local network, IP addresses allow communication across networks and the Internet. Every modern application, cloud platform, and enterprise infrastructure depends on accurate IP addressing and routing.
Key Takeaways¶
- An IP address is a logical network identifier.
- IPv4 uses 32-bit addresses; IPv6 uses 128-bit addresses.
- Public IP addresses are Internet routable; private IP addresses are used within local networks.
- Static IPs are fixed; dynamic IPs are assigned automatically.
- Routers use IP addresses to forward packets between networks.