IPv6 Addressing and Subnetting
Read, compress, and subnet IPv6 addresses with confidence: address anatomy, the zero-compression rules, address scopes/types, and a repeatable nibble-boundary subnetting method.
1. Executive Summary & Objective
IPv6 looks intimidating because of its length, but it is actually easier to subnet than IPv4 — there is no borrowing-bits arithmetic and no “wasted host” counting. The trick is to stop thinking in decimal and start thinking in nibbles (4-bit hex digits).
Objective: Compress/expand any IPv6 address correctly, identify its type and scope from its leading bits, and carve a provider allocation into a clean, delegatable addressing plan on nibble boundaries.
2. Core Concept & Theory (The “Why”)
An IPv6 address is 128 bits, written as eight 16-bit hextets in hex, separated by colons. Two compression rules make them readable:
- Drop leading zeros in each hextet:
0db8→db8,0000→0. - Replace one longest run of all-zero hextets with
::— but only once per address.
2001:0db8:0000:0000:0000:0000:0000:0001
2001:db8:0:0:0:0:0:1 (rule 1)
2001:db8::1 (rule 2)
Address anatomy (global unicast)
A typical global unicast address splits into three parts:
Address types you must recognise on sight
| Leading bits | Range | Meaning |
|---|---|---|
2000::/3 |
2000–3fff | Global unicast (internet-routable) |
fe80::/10 |
fe80–febf | Link-local (on-link only, always present) |
fc00::/7 |
fc00–fdff | Unique local (ULA) (private, like RFC1918) |
ff00::/8 |
ff00… | Multicast (no broadcast exists in IPv6) |
::1/128 |
::1 | Loopback |
3. Architecture & Topology (Visualizing): subnetting a /48
Say your ISP delegates 2001:db8:ab00::/48. You have 16 bits (bits 48–63) to create subnets before you reach the host portion. Allocating on nibble boundaries:
The golden numbers to memorise:
| Allocation | Subnet bits to /64 | Number of /64s |
|---|---|---|
/48 |
16 | 65,536 |
/56 |
8 | 256 |
/60 |
4 | 16 |
/64 |
0 | 1 (a single LAN) |
Your branch office is delegated 2001:db8:ab00:1000::/56. How many VLAN-sized (/64) subnets can it use, and what is the first one?
A /56 to /64 is 8 bits → 256 /64 subnets. The first is 2001:db8:ab00:1000::/64, the next 2001:db8:ab00:1001::/64, and so on up to …:10ff::/64.
4. Command Execution & Deployment (The “How”)
ipv6 unicast-routing
!
interface GigabitEthernet0/0
description VLAN10-USERS
ipv6 address 2001:db8:ab00:10::1/64
!
interface GigabitEthernet0/1
description VLAN20-SERVERS
ipv6 address 2001:db8:ab00:20::1/64
Note you only ever configure the router’s interface address (::1 is a common convention for the gateway). Hosts fill the /64 themselves via SLAAC.
5. Verification & Troubleshooting
show ipv6 interface brief ! shows link-local (fe80::) + global addresses
show ipv6 route connected ! each /64 appears as a connected route
Common mistakes:
- Configuring a non-/64 on a client LAN → SLAAC silently fails.
- Forgetting
ipv6 unicast-routing→ interfaces come up but the router won’t forward or send RAs. - Reusing the same subnet nibble on two interfaces → overlapping routes.
6. Self-Check Challenge
Compress these by hand, then expand the last one:
2001:0db8:0000:0000:00ab:0000:0000:1234fe80:0000:0000:0000:0000:0000:0000:0001- Expand
2001:db8::abcd
Reveal answers
2001:db8:0:0:ab::1234→ longest zero run is the last two hextets, so2001:db8:0:0:ab::1234. (Note: the run beforeabis also two hextets; tie goes to the first/leftmost longest run →2001:db8::ab:0:0:1234is also valid, but a tie must pick one run only.)fe80::12001:0db8:0000:0000:0000:0000:0000:abcd
6.5 Hands-on: verify your subnetting with real Python
Engineers don’t subnet by hand in production — they let Python’s ipaddress module do it, then trust it. This runs real Python 3 in your browser. Fill in the four values, click Run, then Check my work.
7. Key Takeaways
- Compress with two rules: drop leading zeros, one
::for the longest zero run. - Recognise type by leading bits:
2000::/3global,fe80::/10link-local,fc00::/7ULA,ff00::/8multicast. - Subnet on nibble (4-bit) boundaries for readability; address space is not the constraint.
- A /48 = 65,536 /64s; a /56 = 256; always a /64 per LAN.
8. Capture the Flag 🚩
Prove you can delegate address space. Your branch is allocated 2001:db8:ab00:1000::/56. Work out its first /64 subnet (the Python lab above computes it if you’re stuck), and submit it as the flag wrapped like this — format only, not the answer: GTA{2001:db8:ffff:eeee::/64}. Include the ::/64 prefix length, and use the compressed form.
The flag box is at the bottom of the lesson. Capture it to complete the module.
🧪 Want to practise this on your own computer? See how to set up your lab →