How to Disable IPv6 in Mac OS X

Apr 18, 2014 - 8 Comments

IPv6 Mac Some Mac users may wish to disable IPv6 networking support on their machines. This may be desirable to avoid certain networking conflicts, or to increase security for users in higher threat environments, since IPv6 has been found by researchers to be potentially vulnerable to man-in-the-middle and other network attacks.

Though most users don’t use IPv6 directly, disabling IPv6 is not without consequences, and thus should only be done by users who know what they’re doing and why they’re doing it. Some of the core OS X system services, like the discovery service Bonjour, use IPv6. Accordingly, disabling IPv6 may render AirDrop sharing unusable, certain print services will become unavailable, and some other convenient Mac features may turn inoperable as well. This makes it impractical to disable for many.

OS X offers a few ways to turn off IPv6, and we’ll cover a simple method using the command line, as well as demonstrating how to turn IPv6 back on if you decide you need to. Users can also check to see if IPv6 is actively used through System Preferences, which Mac OS X defaults to putting into an automatic state.

Disable IPv6 in Mac OS X through Terminal

Launch Terminal, found within the /Applications/Utilities/ directory, and use the following commands appropriate to your situation. Note that many modern Macs only have wi-fi cards, rendering the ethernet option unnecessary. If the Mac has both wi-fi and ethernet networking, you’ll probably want to disable IPv6 for both interfaces.

Turning off IPv6 support for ethernet:
networksetup -setv6off Ethernet

Disabling IPv6 for wireless:
networksetup -setv6off Wi-Fi

You can also combine both of those commands into a single string to disable both wireless and ethernet, just use the following syntax:

networksetup -setv6off Ethernet && networksetup -setv6off Wi-Fi

Be sure to enter that string onto a single line to issue the command properly.

Re-Enabling IPv6 for Wi-Fi & Ethernet in OS X

Of course, reversing the above change is also possible, and you can re-enable IPV6 support with the following command strings entered into the terminal:

networksetup -setv6automatic Wi-Fi

networksetup -setv6automatic Ethernet

You can also place this into a single command to re-enable IPv6 for Wi-Fi and ethernet like so:

networksetup -setv6automatic Wi-Fi && networksetup -setv6automatic Ethernet

This simply places IPv6 back into the ‘automatic’ configuration state which is default in OS X, if the server you are connecting to does not support IPv6 it won’t be used. Re-enabling IPv6 should return all Bonjour services to their regularly functioning state, including the ever-useful AirDrop file transfer feature.

Those interested can learn more about IPv6 at Wikipedia.

Thanks to @glennzw on Twitter for the tip idea and heads up about the vulnerabilities, don’t forget to follow @osxdaily on Twitter too!

Enjoy this tip? Subscribe to the OSXDaily newsletter to get more of our great Apple tips, tricks, and important news delivered to your inbox! Enter your email address below:

Related articles:

Posted by: Paul Horowitz in Command Line, Mac OS X, Security, Tips & Tricks


» Comments RSS Feed

  1. Rodrigo says:

    Interesting that IPv6 has security problems, but most Mac users are not impacted by this

  2. Forrest says:

    There’s an error in this usage, as it pertains to OSX Mavericks, at least. For the “Ethernet” argument you must specify “Ethernet 1″ or “Ethernet 2″ and so forth. You can view a list of available network services by issuing the following command:

    # networksetup -listallnetworkservices

    in my case, this shows:

    An asterisk (*) denotes that a network service is disabled.
    Bluetooth DUN
    BitFORCE SHA256 SC
    Ethernet 1
    Ethernet 2
    Bluetooth PAN
    VPN (Cisco IPSec)

    in my case, the command line option is issued like this:

    # networksetup -setv6off Ethernet\ 1

    and the same for

    # networksetup -setv6off Ethernet\ 2

    note the use of \ to include the space.

  3. Sebby says:

    I think this is bad advice. In every case that turning off IPv6 is applicable, either supporting it on the network or using security protocols (TLS, VPN) are preferable. All these clever little hacks are basically equally applicable to IPv4–so turning IPv6 off in anything but a fixed networking environment where RAGuard or whatever is not available just means hobbling your system. And, when IPv6 is finally supported in your environment, you’ll have to turn this back on again.

    So in summary: just don’t do it. It’s not worthwhile.

    • John Haxby says:

      I agree.

      Just because there are tools to exploit weaknesses in IPv6 implementations doesn’t mean you shouldn’t use it. IPv4 has it’s own share of weaknesses. WiFi is open to abuse. I don’t see people recommending disabling either of those

      Don’t disable IPv6.

    • Charles says:

      I must agree with Sebby and John. As a network engineer, do NOT turn off IPv6.

      The addresses in IPv4 are running out and you will need to move to IPv6 sooner than later. It is simply not an option to just turn off IPv6 and ignore it.

      There are ‘security’ issues in IPv4 as well, but that doesn’t mean turn off the protocol. We have features and functions in place to mitigate the security holes and those should be implemented rather than turning off IPv6.

      I would recommend that this article be removed and replaced with one detailing how to secure IPv6 on a Mac instead.

    • Louis says:

      Sometimes an interface with ipv6 is behaving in funky ways. I have an issue this moment that I am writing with a Mac on the network. I am sure the ipv6 is causing the problem, I have seen it before. I can open Wireshark and find out what’s going on, or just disable ipv6 and get on with it. I think I’ll take option 2 today :-)

Leave a Reply


Shop for Apple & Mac Deals on

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates