How to Obtain the IPv6 Address of Your Mac and iPad

Finding the IPv6 address of your Mac or iPad isn't extremely difficult. But there are a few technical wrinkles to be aware of. While OS X, with access to the command line and more disclosure in the Network System Preferences, almost nails the details, it's less straightforward with an iPad (or iPhone).

_____________________

IPv6 development by the ISPs is moving along at a good pace, and the chances are good now that, soon, you'll encounter an IPv6 address on one of your Apple products. The goal is to help you interpret what you may see.

This article assumes you have some basic familiarity with IPv6, namely the way IPv6 addresses are constructed. In addition, here is some basic background that may be helpful, “A Layman's Guide to the IPv6 Transition.” 

First, let's look at what's happening on the Mac. Soon, you'll see why I'm starting there. Note that, for the sake of privacy, I have obscured part of my own IPv6 addresses.

Obtaining IPv6 Address on a Mac

The most natural thing to do is look at System Preferences -> Network. If your Mac detects that your ISP and router are offering IPv6 service, (through a router notification called an “advertisement,”) you'll see a single address there.

 

However, if you dig a little deeper, System Preferences -> Network -> Advanced -> TCP/IP, you'll see two IPv6 addresses. What's going on?

What's behind this is that the way a device gets its IPv6 address can vary. It might be self-assigned or it might be assigned to the device. A device can get away with self-assigning its own IPv6 address because of the vast, and I mean vast, number of IPv6 addresses available: 2128 = 3.4 x 1038.

For example, one could assign every square centimeter on the surface of Earth a million different IPv6 addresses each and every second for the next million years and still not exhaust the full 2128 bit address space. (That's a simplification, actually, because the IPv6 address space is segmented for different uses, just like IPv4, but you get the idea.)

There is a protocol for self-assignment, and it has continued to evolve. For some time now, OS X and its sibling iOS have used what's called the EUI-64 address. EUI stands for Extended Unique Identifier. The first 64-bits are the address of a specific network, and the next 64-bits are for use inside the network. To indicate that, you'll see a “/64” appended to the end of the address. What's interesting about EUI-64 is that, in an (ironic) effort to avoid address duplication, the device's hardware MAC address is encoded into the EUI-64 address.

Over time, that practice raised concerns about privacy, and so the concept of a second, parallel “privacy address” or “temporary address” has developed. OS X started using the privacy address starting in 10.7 Lion, so that's why you see two IPv6 addresses on the TCP/IP tab.

How can we tell which is which? Apple hasn't bothered to label the two IPv6 addresses, so we have to do a little work on our own.

The first thing to note is that an EUI-64 address will always have an embedded string “ff:fe” near the middle, so look for that. The other address, then, must be the privacy address.

Method #1. An IPv6 test page. If you go to test-ipv6.comcast.net, it will echo back your Mac's public IPv6 address. (You don't have to be a Comcast customer to access this page, and it provides a lot of information about your IPv6 state of readiness.) Another one I use is Jason Fesler's test-ipv6.com. Here is the result I got.

Method #2. For the geek at heart, we have the venerable command line. Assuming you're on a wired connection, enter the command

~ ifconfig en0

You should see something like this:

Lo and behold, those addresses are nicely labeled, and the one marked “temporary” is your privacy address. It changes, depending on usage conditions. Leaving it the same for a week would make the machine too vulnerable; changing every few minutes would have a performance impact. From my reading, it ends up being updated every 24 to 72 hours.

Notice how the “inet6” address that ends in “79b8”, the one marked “temporary” in the screen shot above is the same as that echoed back from the test site. (We can ignore the (Link-Local) IPv6 address that starts with “fe80” for now.)

Summary. OS X, as of Mountain Lion, generates two IPv6 addresses, an EUI-64 address when the interface is first brought up and a privacy or temporary address which is the one exposed to the Internet.  The reason we keep the EUI-64 address is to provide a stable address for local administrators and, for example, SSH connections. The privacy address varies to keep that device a moving target. The above techniques will help you figure out which is which.

Obtaining IPv6 Address on an iPad

iOS is an operating system designed to be quick and easy to use, mobile and not at all intimidating. As a result, Apple, in iOS 6, has elected not to display the IPv6 address in Settings -> Wi-Fi when you tap the blue right arrow. I have heard that nothing changes there in iOS 7.

However, everything under the hood regarding EUI-64 and privacy addresses remains the same.  It's just a question of getting at the two numbers.

Again, the easiest way to obtain the public IPv6 address on an iPad (or iPhone) is to go to the Comcast IPv6 test page with Safari.

If you're not happy with that level of detail, or you need the EUI-64 address, there is a very handy, nicely engineered iOS app called “IPv6 Toolkit” by James Hamilton. I've exchanged some email with Mr. Hamilton, and he really knows his stuff.

On the Interfaces tab, under “'en0, Wi-Fi Interface,” IPv6 Toolkit displays the IPv6 addresses provided to it by the iOS kernel.  Again, you can look for the “ff:fe” string that earmarks the EUI-64 address so that you can uniquely identify the other one, the privacy address. Perhaps a future version of the app will have explicit labels.

If you only see one address, in addition to the Link-Local address that starts with “fe80”, it's probably because the iPad is in the process of changing to a new privacy address. In time, you'll see two IPv6 addresses there, for a total of three, as shown above.

There is a massive amount of literature surrounding IPv6, and one can quickly become overwhelmed. With that in mind, I've tried to limit the scope of this article. My plan is that by tackling IPv6 in small chunks, a body of easily understood articles can be built up.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.