How to Disable IPv6 in Mac OS X
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.