IPv6 addresses are 128 bits long;
IPv6 chose a hexadecimal format with a colon as separator after each block of 16 bits(2 bytes). That means an IPv6 address is devided into 8 blocks and each block has 16 bits(2 bytes):
- For simplifications, leading zeros of each 16 bit block can be omitted:
- One sequence of 16 bit blocks containing only zeroes can be replaced with “::“. But not more than one at a time, otherwise it is no longer a unique representation.
2001:0db8:100:f101:0:0:0:1 -> 2001:db8:100:f101::1
- The biggest reduction is seen by the IPv6 localhost address:
0000:0000:0000:0000:0000:0000:0000:0001 -> ::1
- The “Base85 coded” IPv6 presentation:
# ipv6calc --addr_to_base85 2001:0db8:0100:f101:0210:a4ff:fee3:9566
- Netmask and subnetting of IPv6:
The host bits in IPv6 take up at least the lower 64 bits (and maybe more), so the netmask is always <= 64 bits. The only exception is the loopback address ::1 which has a netmask of /128. For a LAN, usually just use /64 as the netmask. The ISP may assign a /64, /56 or /48 address block to a site.
That means the netmask number is bigger, the maximum hosts number in the subnet is lesser, and vise versa.
Why there is no IPv5? Here is the answer.
Some commands with using IPv6:
ping6 -I eth0 fe80::250:56ff:fe9b:3d4e