How to setup OSX as a wifi router from the command line

4

1

I need to setup my mac as wifi-router. I want it to appear indistinguishable from a stand alone wifi-router. I don't want internet access.

Things I've tried.

  1. Turning on Internet Sharing

    Doesn't work AFAICT. Probably because I have no internet to share. I was hoping turning it on and picking something to share even if it's not connected to the internet would still make an SSID appear for other machines to connect but no such luck.

  2. Pick "Create Network..." from the network menu

    This gets an SSID to show up for other devices, specifically iOS. Unfortunately there is something special about them as they show up under a special "devices" section below the list of normal wifi hotspots. That's something I'm specifically trying to avoid.

I've noticed in Linux apparently a set of tools, iwconfig etc.. deal with this kind of stuff but I haven't found the equivalent on OSX.

gman

Posted 2014-04-15T05:59:56.110

Reputation: 2 303

I'm also looking for information on this. The following gives more insight into the problem with the "Create Network" option: http://apple.stackexchange.com/questions/154658/how-to-create-a-wifi-hotspot-on-os-x-without-available-internet-connection . Also found some commands for working with wifi networks here but have not tried them yet, so don't know if they will help: http://www.cnet.com/news/how-to-adjust-network-settings-in-os-x-via-the-command-line/

– Wodin – 2015-01-09T22:50:53.403

Are you connected to a WiFi network while you are doing this? If so, you cannot setup WiFi as a router if you need it connected to another WiFi network. Also, do you specifically need command line or any way to make WiFi routing work will do? – phoops – 2014-04-15T06:34:40.313

No I'm not connected to a WiFi network. I want my mac to BE the WiFi network that other devices connect to. Right now I'm making due by hacking a router I own and setting up it's DHCP to point back to my Mac but I'd like to be able to use the Mac as the router. It doesn't have to be command line but I suspect I can't do it otherwise. This is relatively unique thing I'm trying to do. – gman – 2014-04-15T06:43:10.303

Answers

1

With this command you can start and stop the Internet sharing with the command line:

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.InternetSharing.plist

To stop, change the load to unload.

Rittig

Posted 2014-04-15T05:59:56.110

Reputation: 51