Screen Shot 2016 11 17 at 3.24.32 PM

IPv6 MAC OSx Command Line Examples

Check out these additional IPv6 Resources:
Our IPv6 overview course at Udemy
Our IPv6 Custom Profiles for Wireshark
Our IPv6 classes at the Online School

Here are some great MAC OSx command line entries you can make to examine and configure IPv6.

Let’s start with some simple ones. 

Since too many years ago, MAC OSx has supported IPv6 so it is very likely to be turned on.

First, let’s check the following command from the Terminal Window (complete output shown):

ifconfig -a

Screen Shot 2016 11 17 at 3.24.32 PM

You can see my machine is running “Dual Stack” since it has both IPv4 (inet) and IPv6 (inet6).  Yours should be as well.

 

This is a lot of info, so the way to zoom in on lets say the Ethernet interface, which I am using (en0) is to use the following command: 

ifconfig -L en0 inet6

2020 04 19 08 43 04

The -L switch turns on the display of the address Lifetimes.  The ‘inet6’ limits the IPv6 information. 

 Next, let’s take a slightly deeper dive with netstat.

The following command displays the routing table in your computer (this may take some time to completely finish):

netstat -r -f inet6

Screen Shot 2016 11 17 at 3.30.12 PM

 We can clearly see the IPv6 Routing table with the Link Local addresses, Global Unicast addresses (in my case), and the IPv6 Multicast groups.

Let’s see if there has been any general IPv6 traffic on the interfaces.  Now this next command will output a ton of statistics, and we only show a partial output here.  

netstat -s -f inet6

Screen Shot 2016 11 17 at 3.43.29 PM

 

Near the bottom of the output will show various packet counts. 

Pretty cool.

How about PING and TRACE ROUTE for IPv6?  Sure.  Here is how you Ping in IPv6:

ping6 ::1

Screen Shot 2016 11 17 at 3.47.01 PM

Here are the ping6 options:

Screen Shot 2016 11 17 at 3.48.38 PM

 

And here is the Trace route command:

traceroute6 www.facebook.com

Screen Shot 2016 11 17 at 4.00.40 PM

Here are the Tracert options:

Screen Shot 2016 11 17 at 4.01.48 PM

What is that did not work? Hmm.

You may want to check the DNS servers to see if you are able to resolve IPv6.  On MAC, do this with:

scutil --dns | grep nameserver | grep "::"

This should show you IPv6 nameservers.  If you get nothing, then leave off the last grep, and you should only see IPv4.

That does not mean that nameservers or destinations do not support IPv6.  

You can try a dig and see if you get ‘AAAA’ records:

dig AAAA www.facebook.com 

Here is what it might look like when it works:

2020 04 19 09 56 44

OK – what about the Neighbor Discovery?  You use the following command: ndp -a

It will take some time to complete, so be patient.

2020 04 19 08 31 20

To see your IPv6 settings on your MAC use the following command – this will display all settings – if it is a 1 or a 0 then this is most likely a switch (0=off 1=on):

sysctl net.inet6

2020 04 19 10 30 11

 

We won’t go into how to change these settings here, but you could overwrite these with the sysctl command.

It is often useful to pipe this to grep to search for something in particular.  For example, does you system have temporary IPv6 addresses? and what are the settings?

sysctl net.inte6 | grep temp

2020 04 19 10 36 21

We hope this helps you get started on IPv6 on your MAC OSx machine.

I hope you find this article and its content helpful.  Comments are welcomed below.  If you would like to see more articles like this, please support us by clicking the patron link where you will receive free bonus access to courses and more, or simply buying us a cup of coffee!, and all comments are welcome! 

Leave a Comment

Contact Us Here


Please verify.
Validation complete :)
Validation failed :(
 
Your contact request has been received. We usually respond within an hour, but please be patient. We will get back to you very soon.
Scroll to Top