Disable IPV6 on macOS

Gilbert J Palau
Apr 17, 2018 · 1 min read

To Disable IPv6 on OS X from command line. It’s very easy, OS X has a command called networksetup.With this command you can disable IPv6 for a specific device by typing into Terminal.app: networksetup -setv6off Service name.

For example, if you wanted to disable IPv6 for ethernet, it would be: networksetup -setv6off "Ethernet" or for Wireless it would be networksetup -setv6off "Wi-Fi". To list all network devices the command is networksetup -listallnetworkservices.

The script below simply goes one by one device and turns it off, by applying the correct command:

To run the script, copy and paste it on your favorite editor (like text wrangler) and save it to your desktop as ipv6-off.sh then open terminal and go to
cd /users/username/desktopand type chmod a+x ipv6-off.sh to make the script executable. To call the script simply type sudo ipv6-off.sh

After you authenticate, the script will list all the devices you have and will turn off IPv6 on each one of them. This script was tested successfully on High Sierra 10.13.4 and older.

Enterprise macOS

Writing about macOS in the enterprise since 2004

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store