Beginner's Guide to IPv6

What is IPv6?

IPv6, short for ‘Internet Protocol version 6’ is a network layer protocol used to route packets over the internet and other networks. It was created in 1998 by the IETF (Internet Engineering Task Force) as an answer to the ‘IPv4 address exhaustion’ problem, in which the world would run out of IPv4 addresses after 232 (4,294,967,296) addresses were assigned. This happened in January of 2011 when IANA (Internet Assigned Numbers Authority) used the last free /8 address block.

Compared to IPv4’s 32-bit addresses, IPv6 uses 128-bit addresses which consist of eight numbered strings, each containing four alphanumeric characters separated by a colon. The maximum amount of IPv6 addresses completely dwarfs IPv4, capping out at 2128 (340,282,366,920,938,463,463,374,607,431,768,211,456) addresses.

All of the bits in an IPv6 address are grouped by 4, for a total of 8 groups, and use hexadecimal numbers rather than decimal numbers. Hexadecimal numbers differ from a decimal, which is a base-10 numbering system, by being a base-16 numbering system; starting with the number 0 and ending with the letter F before adding another digit.

Comparing decimal and hexadecimal side-by-side:

Decimal 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Hexadecimal 0 1 2 3 4 5 6 7 8 9 A B C D E F 10

An IPv6 address will look like this:

2001:0db8:85a3:0000:0000:8a2e:0370:7334

Interestingly, to save on space, you can shorten a string of 0s in an IPv6 address and it means the same thing.

2001:0db8:85a3:0:0:8a2e:0370:7334

Even still, adjacent groups of 0s can be shortened more.

2001:0db8:85a3::8a2e:0370:7334

The amount of groups of repetitive 0s is implied with knowing the length of an IPv6 address. Since this address has 24 visible bits in it, you know that 8 bits of 0s exist between the two colons.

An IPv6 address is split into two components that are split at the 64-bit line. The first half is the network component, and the second half is the node component.

IPv6 address
2001:0db8:85a3:0000:0000:8a2e:0370:7334
Network Node
2001:0db8:85a3:0000 0000:8a2e:0370:7334

The network component is used for routing, and the second half, the **node** component, is used for the interface address, and is derived from the actual MAC address of the device.

Network

The first 64-bits, or network component is split further into two sections. The first 48-bits is called the Global Unicast Address and the last 16-bits is called the Subnet Id.

There are three different types of IPv6 addresses, which have decreasing levels of scope:

IPv6 Address Type Routing Scope
Global Unicast Address Entire Internet
Unique Local Internal Network
Link Local Network Link

Global Unicast Address - Equivalent to public IPv4 addresses. Always start with 2001: These are allocated by the IANA to ISPs, which then allocate them further.

Unique Local These are equivalent to the 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 blocks used in private networks.

Link Local - These are equivalent to APIPA addresses, or the 169.254.0.0/16 block, when no automatic addressing service lik DHCP is found.

Some ways in which these are used:

Each device assigns itself a Link Local address, derived from either the MAC, or a random generated number. This is used to talk to the router so that it can get a Unique Local address.

Routers use their Link Local addresses to communicate to devices on its own network, and the Link Local address of the router is the default gateway of every device on the network. Additionally, routers use Link Local addresses to communicate to the next hop.

Much like IPv4, there are several types of automatic addressing for IPv6

Option 1: Static DHCPv6 (stateless)

This works the same was a static addressing with DHCP for IPv4. (Saying DHCP for IPv4 is redundant, as that’s all it’s used for, however I’ve stated it this way this one time for clarity.)

Option 2: Dynamic addressing DHCPv6 (stateful)

This works the same as dynamic addressing for DHCP.

Option 3: SLAAC without DHCPv6

Much like APIPA addresses in IPv4, addresses are assigned by the hosts themselves.

Option 4: SLAAC with DHCPv6

The same as option 3, however some information, most importantly the DNS address, is taken from the DHCPv6 server.

Creating an IPv6 route through an interface in linux:

For point-to-point links sometimes you’ll need to create a static route. Here’s how you do it in linux.

Using IP

	/sbin/ip -6 route add {ipnetwork}/{prefixlength} dev {device{}

Example:

	/sbin/ip -6 route add 2000::/3 dev eth0 metric 1

Using route

	/sbin/route -A inet6 add {network}/{prefixlength} dev {device}

Example:

	/sbin/route -A inet6 add 2000::/3 dev eth0

Most ISPs do not have IPv6 addressing yet, and you’ll need a tunnel to get an IPv6 address, but some of the major ISPs that do include:

  • Xfinity
  • CenturyLink
  • Spectrum
  • Frontier
  • Cox
  • Windstream
  • HughesNet
  • Viasat

Tunnelbrokers:

Another solution is to use an IPv6 tunnel broker like Hurricane Electric, which is free and has a wide array of servers across the globe to choose from.

You’ll have to register through them to get set up, after which they’ll send you a link which you can use to set up and activate your tunnel.