Ravindra BagaleCourses & study guides मराठी Track your progress

Chapter 1: Networking Fundamentals

1.5 IPv6

Friends, IPv4 addresses are running out, and that is why IPv6 came. Don't worry – the address looks long, but once you understand the two shortening rules it becomes very easy to read.

Why IPv6 is needed

  • IPv4 has only ~4.3 billion addresses, and the regional registries have run out of fresh IPv4 blocks.
  • IPv6 has 2^128 ≈ 3.4 × 10^38 addresses — enough to give every device its own public address, removing the need for NAT.
  • Built-in features: simpler header, auto-configuration (SLAAC), better multicast, and no broadcast.
  • On AWS, public IPv4 addresses are charged per hour, whereas IPv6 addresses are free — another practical reason to learn IPv6.

Format

IPv6 is 128 bits, written as 8 groups of 4 hexadecimal digits (16 bits each), separated by colons:

2001:0db8:0000:0000:0000:ff00:0042:8329
|16b|                                    8 groups x 16 bits = 128 bits

Shortening rules

  1. Leading zeros in any group may be removed: 0db8 → db8, 0042 → 42, 0000 → 0.
  2. One continuous run of all-zero groups may be replaced by :: — only once per address (otherwise the length would be ambiguous).
Full form Short form
2001:​0db8:​0000:​0000:​0000:​ff00:​0042:​8329 2001:​db8::​ff00:​42:​8329
fe80:​0000:​0000:​0000:​0202:​b3ff:​fe1e:​8329 fe80::​202:​b3ff:​fe1e:​8329
0000:​0000:​0000:​0000:​0000:​0000:​0000:​0001 ::1 (loopback)
2001:​0db8:​0000:​0001:​0000:​0000:​0000:​0001 2001:db8:0:1::1

Important IPv6 address types

Prefix Type IPv4 equivalent
::1/128 Loopback 127.0.0.1
fe80::/10 Link-local (auto on every interface) 169.254.x.x
fc00::/7 (fd00::/8 in practice) Unique local (private) RFC1918 ranges
2000::/3 Global unicast (public) Public IPv4
ff00::/8 Multicast 224.0.0.0/4
::/0 All IPv6 addresses 0.0.0.0/0

In AWS, a VPC can get an Amazon-provided /56 IPv6 block and each subnet a /64. Remember to add ::/0 rules in security groups if you want IPv6 clients to reach your server.

Ravindra Bagale's Tip

A common mistake is using :: twice in the same address (2001::1::5) – that is invalid. Use :: only once, and in the other groups remove only the leading zeros. And on AWS, don't forget that IPv6 clients need a separate ::/0 rule in the security group.

Practice task

Hya don addresses che short form liha: 2001:0db8:0000:0000:0000:ff00:0042:8329 aani fe80:0000:0000:0000:0202:b3ff:fe1e:8329. Mag varchya table ne tumche uttar match kara, aani 2001:db8::1::2 ka chuk aahe te ek line madhe liha.