Skip to content

Instantly share code, notes, and snippets.

@cuibonobo
Created August 3, 2015 16:53
Show Gist options
  • Save cuibonobo/8aed48ac9c72df352e8a to your computer and use it in GitHub Desktop.
Save cuibonobo/8aed48ac9c72df352e8a to your computer and use it in GitHub Desktop.
Manage internet sharing on Mac OS X
  • Get the currently connected computers: arp -i en1 -a and arp -i bridge100 -a
  • Filter connections by MAC address: http://michaelleo.com/blog/2011/02/eye-fi-upload-via-mac-os-x-internet-sharing/
  • Grab the list of DHCP leases from /private/var/db/dhcpd_leases (this won't necessarily tell you who is connected, but it's good for knowing who has connected)
  • Enable Internet Sharing with sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.InternetSharing.plist (and use unload to disable)
  • Messing with the Internet Sharing settings directly is giving me inconsistent results. For my particular case, it's easiest to just set up my Sharing settings manually and then turn the WiFi on and off based on my needs with networksetup -setairportpower en1 on or networksetup -setairportpower en1 off
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment