Implementing IP Addressing: Getting Started with IPv4 and IPv6
This beginner-friendly post covers how to implement IP addressing using both IPv4 and IPv6. It explains static and dynamic assignment, IPv6 address types, SLAAC, and key differences between the two protocols. Practical Linux CLI examples are included to reinforce the concepts.
If you've ever set up a home network or configured a device to connect to the internet, you've already interacted with IP addressing, even if you didn't realize it. Implementing IP addressing is one of the most fundamental skills in networking, and it's a core topic in the CompTIA Network+ exam (Objective 3.4). In this post, we'll walk through the basics of both IPv4 and IPv6, and show you how addresses get assigned and managed in real networks.
Why IP Addressing Matters
Every device on a network needs a unique identifier so that data can be delivered to the right destination. That identifier is the IP address. Think of it like a mailing address: without one, no one knows where to send the letter. When you implement IP addressing on a network, you're essentially building the directory that makes communication possible.
IPv4: The Foundation
IPv4 addresses are 32-bit numbers, written in dotted-decimal notation. Each address is made up of four octets separated by periods, like 192.168.1.10. Each octet can range from 0 to 255, giving us about 4.3 billion possible addresses. That sounds like a lot, but the internet exhausted the public IPv4 pool years ago, which is part of why IPv6 was developed.
Static vs. Dynamic Assignment
There are two main ways to assign IPv4 addresses to devices:
- Static assignment: You manually configure the IP address, subnet mask, default gateway, and DNS server on the device. This is common for servers, printers, and network infrastructure.
- Dynamic assignment (DHCP): A DHCP server automatically assigns an address from a pool. This is the standard approach for end-user devices like laptops and phones.
Here's an example of configuring a static IPv4 address on a Linux system using the ip command:
sudo ip addr add 192.168.1.10/24 dev eth0
sudo ip route add default via 192.168.1.1And to verify the configuration:
ip addr show eth0You should see output showing the assigned address and prefix length, confirming your network setup is in place.
IPv6: The Future of IP Management
IPv6 uses 128-bit addresses, written in hexadecimal and separated by colons, like 2001:0db8:85a3:0000:0000:8a2e:0370:7334. That massive address space (340 undecillion addresses) means we won't run out anytime soon.
IPv6 addresses can be shortened by removing leading zeros in each group and collapsing consecutive all-zero groups with ::. So the address above becomes 2001:db8:85a3::8a2e:370:7334.
IPv6 Address Types
When you implement IP addressing with IPv6, you'll work with several address types:
- Global unicast: Routable on the public internet, similar to a public IPv4 address. These start with
2000::/3. - Link-local: Automatically assigned to every IPv6-enabled interface. They start with
fe80::/10and are only valid on the local network segment. - Loopback: Represented as
::1, equivalent to127.0.0.1in IPv4. - Unique local: Similar to private IPv4 addresses. These start with
fc00::/7and are used for internal routing.
How IPv6 Addresses Get Assigned
IPv6 introduces a powerful feature called SLAAC (Stateless Address Autoconfiguration). A device can generate its own global unicast address by combining the network prefix advertised by the router with its own interface identifier. No DHCP server is required, though DHCPv6 is also available for more controlled IP management environments.
You can view IPv6 addresses on a Linux system with:
ip -6 addr showKey Differences at a Glance
- Address length: IPv4 is 32 bits; IPv6 is 128 bits.
- Notation: IPv4 uses decimal with dots; IPv6 uses hexadecimal with colons.
- Autoconfiguration: IPv4 relies on DHCP; IPv6 supports SLAAC natively.
- Header complexity: IPv6 has a simplified header, which improves routing efficiency.
- NAT: IPv4 networks commonly use NAT to conserve addresses; IPv6 is designed to eliminate the need for it.
What's Next
Now that you understand how to implement IP addressing with both IPv4 and IPv6, the logical next step is diving into subnetting. Subnetting lets you divide a larger network into smaller, more manageable segments, and it's one of the most tested skills on the Network+ exam. In the next post, we'll break down how subnet masks work and walk through the math step by step, no calculator anxiety required.
Tools and resources for this topic
- CompTIA Network+ Study Guide โ Comprehensive N10-009 exam preparation covering all five domains.