Skip to content

Instantly share code, notes, and snippets.

@Freccia
Last active August 20, 2017 19:19
Show Gist options
  • Save Freccia/74de11cea940b2a559a7f67e4d3e682f to your computer and use it in GitHub Desktop.
Save Freccia/74de11cea940b2a559a7f67e4d3e682f to your computer and use it in GitHub Desktop.
Disable ipv6 globally on OS X
#!/bin/bash
#########################
# written by freccia #
# 29.06.2017 #
# Disables ipv6 on OS X #
#########################
# This script checks for interfaces actually up
# then it disables ipv6 on these
CYAN="\033[36m"
ENDC="\033[0m"
IFACES="`networksetup -listallnetworkservices`"
count=0
while read -r iface; do
if [[ count -ne 0 ]];then
echo -e "Disabling ipv6 for $CYAN $iface $ENDC ..."
networksetup -setv6off "$iface"
networksetup -getinfo "$iface"
echo
fi
count=$((count+1))
done <<< "$IFACES"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment