IPv6 Foun­da­tion Part 9: IPv6 on Mac

IPv6 Foundation Part 9 - IPv6 on Mac
All the Tricks and Com­mands! Now Free! How IPv6 on Mac works, how to enable, dis­able & trou­bleshoot it! Find all your answers and more in this free Course!

Table of Con­tents

About this course

So you are inter­est­ed in IPv6, which is absolute­ly great!

IPv6 is not only the future of net­work­ing, it is already here today! All the big play­ers on the Inter­net are already IPv6 enabled and it is now time for you to join the par­ty!

This course cov­ers all major aspects of the new Inter­net Pro­to­col and what changed, com­pared to IPv4. You will under­stand the fun­da­men­tals and be ahead of your peers that are still on the sink­ing ship of IPv4! As of today, there are no IPv4 address­es left and we have no oth­er option but to go ahead and deploy IPv6.

IPv6 Act Now

IPv6 Foun­da­tion Part 9: IPv6 on Mac

Let’s have a look at IPv6 sup­port and some his­to­ry for Microsoft Win­dows, Apple MacOS and Lin­ux imple­men­ta­tions of our new Inter­net Pro­to­col.

For sure, Apple MacOS or pre­vi­ous­ly OS X has also been ear­ly to adopt IPv6 and its imple­men­ta­tion in Catali­na, Mojave and oth­er recent ver­sions can today be called com­plete and sta­ble. By default IPv6 on Mac OS, is enabled and does not have to be con­fig­ured man­u­al­ly, unless you want to.

IPv6 Configuration on Apple MacOS

The screen­shot above has a man­u­al con­fig­u­ra­tion using the graph­i­cal user inter­face (GUI) high­light­ed. Usu­al­ly the option select­ed will be Auto­mat­ic on a reg­u­lar client.

There are also CLI com­mands for MacOS that I would like to show you.

Be aware, that in gen­er­al you can use most open source GNU core util­i­ties also on a Mac by installing home­brew. I like to have some of my favorite “gnu­tils” handy on my Mac.

The fol­low­ing com­mands are all built-in MacOS com­mands, no addi­tion­al 3rd par­ty com­po­nents!

How to dis­play address­es for IPv6 on Mac in Ter­mi­nal

$ ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>
inet 127.0.0.1 netmask 0xff000000
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
nd6 options=201<PERFORMNUD,DAD>
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=400
ether f0:18:98:13:23:1d
inet 172.23.5.46 netmask 0xffffff00 broadcast 172.23.5.255
inet6 fe80::ee:7e0d:8941:1be5%en0 prefixlen 64 secured scopeid 0x6
inet6 2003:c8:b711:300:c18:348e:7db5:8468 prefixlen 64 autoconf secured
inet6 2003:c8:b711:300:852:3b02:5db2:3c18 prefixlen 64 autoconf temporary
nd6 options=201<PERFORMNUD,DAD>
media: autoselect
status: active
utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
inet6 fe80::fb1d:654f:cfbf:16a1%utun0 prefixlen 64 scopeid 0xf
nd6 options=201<PERFORMNUD,DAD>

I exclud­ed about 80% of oth­er out­put from this com­mand, because it is real­ly long. I still want­ed to pro­vide this semi-full out­put for you to be able to read and under­stand the dif­fer­ent IPv6 address­es in this Mac­Book Pro which is just con­nect­ed to WiFi. From what you have learned this far, you should be able to make sense of them all. Or you can read back some more.

Like stat­ed before, you can also install the iproute2 GNU pack­ages from home­brew to gain access to the reg­u­lar GNU utils if you pre­fer those.

You can get the out­put from only one sin­gle inter­face with the fol­low­ing com­mand:

$ ifconfig en0

How to con­fig­ure a sta­t­ic address for IPv6 on Mac in Ter­mi­nal

$ sudo ifconfig en0 inet6 2003:c8:b711:300:c18:348e:7db5:9999 prefixlen 64 alias

You need the sudo com­mand to do this sys­tem lev­el change, unless you are already root (su), which your reg­u­lar user account should not be.

How to remove a sta­t­ic address for IPv6 on Mac in Ter­mi­nal

$ sudo ifconfig en0 inet6 delete 2003:c8:b711:300:c18:348e:7db5:9999 prefixlen 64

To remove an address, just add the delete word and drop the alias word. That’s it. Ver­i­fy cor­rect removal with ifcon­fig <inter­face-name>, e.g. ifcon­fig en0.

How to dis­play the neigh­bor cache for IPv6 on Mac

$ ndp -a

ndp is the MacOS tool to con­trol and diag­nose the IPv6 neigh­bor dis­cov­ery pro­to­col. Check out man ndp for full func­tion­al­i­ty or this very sim­i­lar FreeB­SD ndp man page.

How to con­fig­ure a default route for IPv6 on Mac

$ sudo route add -inet6 ::/0 fe80::ee:7e0d:8941:1be5%en0

On MacOS, if you set a default route via a Link-Local address (fe80::), you have to add the out­go­ing inter­face with %inter­face (like in the above exam­ple -> %en0) to the com­mand, or else the oper­at­ing sys­tem can­not know which inter­face is fac­ing the default router!

A default route is prob­a­bly the most impor­tant route for a host, because it acts as a catch-all route and all traf­fic that is not sent to anoth­er “more spe­cif­ic” des­ti­na­tion is sent here…

With IPv6, remem­ber the spe­cial des­ti­na­tion in this case is ::/0, which means “all routes

How to set a gener­ic route for IPv6 on Mac

$ sudo route add -inet6 2a02:69e0::/32 2003:c8:b711:300:::1

Apart from one default route, we might have the need for addi­tion­al more spe­cif­ic routes or spe­cial routes, that are reach­able via a dif­fer­ent path than the default route. The syn­tax is essen­tial­ly the same, just replace the spe­cial route ::/0 with a more spe­cif­ic in the same prefix/length nota­tion that is spe­cif­ic for IPv6.

You do not need to include the %inter­face here, because we are using a glob­al address as the next hop, which is unique and the oper­at­ing sys­tem knows which inter­face it is con­nect­ed to. It would also be pos­si­ble to route via a Link-Local address again, but in this case the %en0 would be nec­es­sary like in the pre­vi­ous default route exam­ple!

How to remove a gener­ic route for IPv6 on MacOS

$ sudo route delete -inet6 ::/0 fe80::ee:7e0d:8941:1be5%en0

Any route like more specifics and the default route can be removed again using the above delete com­mand, which is iden­ti­cal to the com­mand to add a route, just replace the add with a delete.

How to dis­play the rout­ing table for IPv6 on Mac

$ netstat -rn
Internet6:
Destination Gateway Flags Netif Expire
default fe80::%utun0 UGcI utun0
::1 ::1 UHL lo0
2003:c8:b711:300::/64 link#6 UC en0
2003:c8:b711:300:852:3b02:5db2:3c18 f0:18:98:13:23:1d UHL lo0
2003:c8:b711:300:c18:348e:7db5:1 link#6 UHLWIi en0

At last, there is the one sim­ple com­mand to dis­play the Apple MacOS rout­ing table. The com­mand first out­puts the IPv4 rout­ing table, you need to scroll down a bit until the part that starts with Internet6.

How to do a Ping to ver­i­fy con­nec­tiv­i­ty for IPv6 on Mac

$ ping6 google.com
PING google.com(2a00:1450:400c:c0a::65) 56 data bytes 64 bytes from 2a00:1450:400c:c0a::65: icmp_seq=1 ttl=54 time=12.7 ms 64 bytes from 2a00:1450:400c:c0a::65: icmp_seq=2 ttl=54 time=13.0 ms 64 bytes from 2a00:1450:400c:c0a::65: icmp_seq=3 ttl=54 time=13.0 ms 64 bytes from 2a00:1450:400c:c0a::65: icmp_seq=4 ttl=54 time=12.9 ms

Huh? Yes, you’re right, the syn­tax and out­put of ping6 on Mac is exact­ly the same as on Lin­ux. Ping6 is the IPv6 alter­na­tive to the old ping com­mand that is used for IPv4. Ping is used to check if there is end-to-end reach­a­bil­i­ty between your host and a des­ti­na­tion. You can either use an IPv6 address for the des­ti­na­tion, or use a DNS name (it works!) but be aware — when using a DNS name you can­not be 100% sure that IPv6 is used as trans­port instead of IPv4.

Check out the parts about Source Pro­to­col Selec­tion and Source Address Selec­tion to under­stand which Pro­to­col and which address is used when ini­ti­at­ing a con­nec­tion!

How to do a Tracer­oute to ver­i­fy Rout­ing and Path for IPv6 on Mac

$ traceroute6 google.com
traceroute to google.com (2a00:1450:400c:c0a::8b), 30 hops max, 80 byte packets
1 denuecore01.pall.as (2a02:69e0:500::1) 0.717 ms
2 denuecore00-2.pall.as (2a01:4f8:0:e0b0::25) 0.320 ms
3 core12.hetzner.de (2a01:4f8:0:3::39) 0.389 ms
4 2a01:4f8:0:3::fa (2a01:4f8:0:3::fa) 3.560 ms
5 juniper4.ffm.hetzner.de (2a01:4f8:0:3::e) 3.521 ms
6 de-cix10.net.google.com (2001:7f8::3b41:0:1) 40.654 ms
7 2001:4860::1:0:4ca2 (2001:4860::1:0:4ca2) 4.579 ms
8 2001:4860::2:0:a94a (2001:4860::2:0:a94a) 12.977 ms
9 wl-in-x8b.1e100.net (2a00:1450:400c:c0a::8b) 12.736 ms

Same again, Tracer­oute is used to see the dif­fer­ent rout­ing (Lay­er 3) hops along the path of a pack­et that is trans­ferred between the local host and a remote des­ti­na­tion. The MacOS ter­mi­nal com­mand is also traceroute6 and it is the IPv6 alter­na­tive to the IPv4 tracer­oute com­mand. You can either use an IPv6 address for the des­ti­na­tion, or use a DNS name (it works!) but be aware — when using a DNS name you can­not be 100% sure that IPv6 is used as trans­port instead of IPv4.

Same as with Ping, check out the parts about Source Pro­to­col Selec­tion and Source Address Selec­tion again to under­stand which Pro­to­col and which address is used when ini­ti­at­ing a con­nec­tion.

How to see live Pack­et Loss using mtr for IPv6 on Mac

My Traceroute mtr IPv6 output

You know what tracer­oute is and why it is so help­ful. The Lin­ux util­i­ty My Tracer­oute (mtr), which is also avail­able for MacOS via home­brew, does a kind of a live tracer­oute and sends pack­ets every sec­ond. You are able to see live where pack­et loss hap­pens or laten­cy increas­es. I love this tool and high­ly rec­om­mend you try it out, for IPv6 and IPv4!

How to dis­able IPv6 on Mac

I can­not rec­om­mend dis­abling IPv6 on MacOS and sug­gest learn­ing enough about it so you can con­fig­ure and use it to its fullest poten­tial. Still, in some cas­es you might want or even need to dis­able it.

The pro­ce­dure to dis­able IPv6 on Catali­na is the same as to dis­able IPv6 on Mojave and ear­li­er Ver­sions such as High Sier­ra an so on. 

First, find out what your “Net­work Ser­vice” is called, that you want to dis­able IPv6 on:

$ networksetup -listallnetworkservices
An asterisk (*) denotes that a network service is disabled.
WiFi
iPhone USB
iPad USB
Bluetooth PAN
Thunderbolt Bridge
Mac: Device VPN

Now you can use this name in the fol­low­ing com­mand to dis­able IPv6 on your Mac:

$ networksetup -setv6off WiFi

The WiFi key­word is com­ing from the out­put of the above com­mand which lists all net­work ser­vices the Mac can see.

Ver­i­fy with ifcon­fig, if all address­es have been removed accord­ing­ly.

Now that you know how to dis­able IPv6 on MacOS, I’m sure you can’t wait to turn it on again, because it is great and we love it:

How to enable IPv6 on Mac

I’m so glad you want to (re-) enable IPv6 on your Mac and it is not hard at all, just find out what your cor­re­spond­ing inter­face is called using this com­mand:

$ networksetup -listallnetworkservices
An asterisk (*) denotes that a network service is disabled.
WiFi
iPhone USB
iPad USB
Bluetooth PAN
Thunderbolt Bridge
Mac: Device VPN

Now you can use this name in the fol­low­ing com­mand to enable IPv6 on your Mac:

$ networksetup -setv6automatic WiFi

After a cou­ple of sec­onds you should have your Link-Local address(es) auto-gen­er­at­ed using EUI-64 and maybe glob­al address­es and rout­ing active, check with ifcon­fig for address­es, net­stat ‑rn for the IPv6 rout­ing table and the oth­er com­mands from this chap­ter.

Thank You

Thank you for attend­ing the Orig­i­nal IPv6 Foun­da­tion Mas­ter Class! You can book­mark this site to use it as a quick ref­er­ence in case you need to re-read some­thing and you can share this page to social media and your friends and col­leagues. Stay tuned to this blog for more in-depth sto­ries like this one.

Rec­om­mend­ed Resources for addi­tion­al read­ing

Apart from the links through­out this course I rec­om­mend the fol­low­ing resources for addi­tion­al infor­ma­tion:

  1. The Inter­net Soci­ety (ISOC) IPv6 Por­tal
  2. Test your IPv6 con­nec­tiv­i­ty on test-ipv6.com
  3. The offi­cial IANA list of assigned IPv6 address space is very inter­est­ing
  4. The Google IPv6 deploy­ment sta­tis­tics
  5. The RIPE NCC IPv6 work­ing group and mail­ing list

Book rec­om­men­da­tions on IPv6

I can rec­om­mend the fol­low­ing 3 books (Ama­zon refer­ral links) which I enjoyed read­ing:

This con­cludes IPv6 Foun­da­tion Part 9: IPv6 on Mac of the orig­i­nal IPv6 Foun­da­tion Mas­ter Class.

Pre­vi­ous Part: IPv6 Foun­da­tion Part 8: IPv6 on Lin­ux

Next Part: IPv6 Foun­da­tion Part 10: IPv6 DNS, Mon­i­tor­ing & Address Man­age­ment

Share this post

Share on pocket
Share on reddit
Share on facebook
Share on twitter
Share on linkedin
Share on xing