Solved OSX cli Join hidden network
-
On a Mac its en1 not en0 for WiFi.
-
@DustinB3403 said in OSX Cli Join hidden network:
@black3dynamite said in OSX Cli Join hidden network:
http://osxdaily.com/2011/04/12/connect-wireless-network-command-line/
networksetup -setairportnetwork en0 HiddenWiFiValley password1
should work.Yeah that documentation is old and doesn't work. I've already read it.
Although its old, its still valid.
-
@black3dynamite said in OSX Cli Join hidden network:
On a Mac its en1 not en0 for WiFi.
en0 based on me looking at the hardware report for my macs.
-
@DustinB3403 said in OSX Cli Join hidden network:
@black3dynamite said in OSX Cli Join hidden network:
On a Mac its en1 not en0 for WiFi.
en0 based on me looking at the hardware report for my macs.
Oh, so Macs you have are the ones without a Ethernet port?
-
@black3dynamite said in OSX cli Join hidden network:
@DustinB3403 said in OSX Cli Join hidden network:
@black3dynamite said in OSX Cli Join hidden network:
On a Mac its en1 not en0 for WiFi.
en0 based on me looking at the hardware report for my macs.
Oh, so Macs you have are the ones without a Ethernet port?
Correct, WiFi only.
-
Which is why I said, it adds the connection, but it fails to connect. I can go into the GUI and connect, but that defeats the point.
I want to add the connection, and connect automatically without having to fuss around with the damn gui.
-
@DustinB3403 said in OSX Cli Join hidden network:
Which is why I said, it adds the connection, but it fails to connect. I can go into the GUI and connect, but that defeats the point.
I want to add the connection, and connect automatically without having to fuss around with the damn gui.
So in the GUI, is auto-join enabled after you add the network?
-
@black3dynamite said in OSX cli Join hidden network:
@DustinB3403 said in OSX Cli Join hidden network:
Which is why I said, it adds the connection, but it fails to connect. I can go into the GUI and connect, but that defeats the point.
I want to add the connection, and connect automatically without having to fuss around with the damn gui.
So in the GUI, is auto-join enabled after you add the network?
Yes, but it doesn't connect. Maybe with a reboot. But that would kind of defeat the point I'm hoping for.
-
@DustinB3403 said in OSX Cli Join hidden network:
@black3dynamite said in OSX cli Join hidden network:
@DustinB3403 said in OSX Cli Join hidden network:
Which is why I said, it adds the connection, but it fails to connect. I can go into the GUI and connect, but that defeats the point.
I want to add the connection, and connect automatically without having to fuss around with the damn gui.
So in the GUI, is auto-join enabled after you add the network?
Yes, but it doesn't connect. Maybe with a reboot. But that would kind of defeat the point I'm hoping for.
Restart the network service instead of rebooting
-
@black3dynamite said in OSX cli Join hidden network:
@DustinB3403 said in OSX Cli Join hidden network:
@black3dynamite said in OSX cli Join hidden network:
@DustinB3403 said in OSX Cli Join hidden network:
Which is why I said, it adds the connection, but it fails to connect. I can go into the GUI and connect, but that defeats the point.
I want to add the connection, and connect automatically without having to fuss around with the damn gui.
So in the GUI, is auto-join enabled after you add the network?
Yes, but it doesn't connect. Maybe with a reboot. But that would kind of defeat the point I'm hoping for.
Restart the network service instead of rebooting
Wooh, now that is an idea.
-
So this documentation is just dated or something. So this is what works.
networksetup -addpreferredwirelessnetworkatindex en0 SSID index SecurityType 'SuperSecretPassword'
Turn the interface off next
networksetup -setairportpower en0 off
Then on
networksetup -setairportpower en0 on
Then connect with
networksetup -setairportnetwork en0 SSID 'SuperSecretPassword'
-
As an additional option, if you don't want your workstation to automatically connect to this network (on startup, while roaming etc) use this
networksetup -removedpreferredwirelessnetwork Interface SSID
That disables the autojoin functionality on OSX 10.14.6, but you would still have connected to the network from the initial answer.