How to create a password protected ad-hoc network on Yosemite when not connected to the internet

Solution 1:

I'd been looking a long time for this answer as well to be able to play games on a local network.

Since awhile (for some annoying reason) Apple only allows an active network to be shared over wifi with a password.

To create your own "active" network, in terminal run the 2 following commands.

# Idk if this is necessary. if you lost your 127.0.0.1, creating this should fix it:
# sudo networksetup -createnetworkservice Loopback lo0
# sudo networksetup -setmanual Loopback 127.0.0.1 255.255.255.255
##
sudo networksetup -createnetworkservice FakeNet lo0
sudo networksetup -setmanual FakeNet 192.168.1.56 255.255.255.255

This creates a new network conection that (although the preferences show it as inactive) can be shared from the internet sharing preference pane to Wifi with a password.

To share the connection,

  1. go system preferences
  2. Then sharing preferences
  3. select FakeNet as the connection to share from
  4. share to wifi
  5. advanced settings allow a password to be set

Source: https://www.laszlopusztai.net/2016/02/14/creating-a-wi-fi-access-point-on-os-x/