Fun with IPv6, part 1

September 17, 2022    internet networking devops sysadmin

This past week, I realized that my internet provider had (finally, after years of promising) enabled IPv6 on my home internet connection. As a nerd, I spent some time digging in to IPv6 and figuring out how it works.

I’ll be writing a couple posts on this. The first one will cover the background of what IPv6 is, and why it’s necessary in the long run.

Background, AKA what is IPv6?

IPv4 is the previous, and still most widely-used, version of IP. It’s the low-level protocol that your computer uses to talk with other computers online. You might be familiar with IP addresses in the format 192.168.1.1. This is an IPv4 address. Your computer (or phone, tablet, toothbrush, etc) gets an IP address, and uses that address to communicate with other computers on the internet when you browse websites or use other online services.

We have been living for a while in a world where the total number number of IPv4 addresses available for new devices on the internet is running out. IPv4 uses a 32-bit number to represent addreses, which means that there a total of 2 to the 32nd power, or approximately 4.2 billion, addresses that exist. It’s somewhat intuitive that given the number of people on the planet and the number of personal computers, phones, servers, and other internet-connected devices that exist worldwide, that we are close to exhausting the number of addresses.

IPv6 is the successor to IPv4. IPv6 uses a 128-bit number to represent addresses, which, through the Power of Mathematics™, means that there are 2 to the 128th power, or approximately 340,282,366,920,938,000,000,000,000,000,000,000,000 possible IPv6 addresses. You can find a lot of fun explanations online for how big this number really is, but the one that I’m fond of is that you could have an IP address for every atom on the earth, and have enough addresses left over to cover another ~100 earth-sized planets. It’s a large number.

This must be a new thing, right?

I was surprised to learn that IPv6 was introduced as a standard in 1995. It’s still not supported by a majority of the providers/devices on the internet, although adoption is slowly increasing.

It turns out it’s really hard for ISPs, hosting providers, etc to switch their systems over, and there’s a chicken-and-egg problem: since most people are still fine with IPv4, there’s not much incentive to switch. The organizations that hand out IP addresses worldwide have also developed some new tricks (like freeing previously-reserved blocks of IPs) for extending the time until IPv4 addresses run out.

But eventually the IPv4 address space will be well and truly exhausted, and our devices will need to speak IPv6. Now that my ISP supports it, I figured I’d enable it and try it out.

Getting it set up

I had previously configured my router to grab an IPv6 address as soon as one was available, so I didn’t have to do much to get it set up. Once my computer had an IPv6 address, I learned my first lesson: one of the best things about IPv6 is that each device on your network can get its own public IP address. And, the worst thing about IPv6 is that each device on your network can get its own public IP address.

There’s a thing called NAT which almost all ISPs require your router to use, which hides your computers from the public internet at large and provides a little bit of security for your devices. By default, with IPv6, NAT is gone by default, and Evil Hackers are capable of reaching your devices directly. This means you’d better hope you have a firewall protecting you.

I didn’t realize for several days that my router’s IPv6 firewall was not configured at all by default, so all of my devices were wide open to the internet. Oops, lesson learned.

Next up

In a follow up post, I’ll describe some of the challenges of having IPv6 and go into some more technical detail about services I set up on my network.