Don't Auto-Join WiFi Network?

musat
Contributor III

Hello,

We have two WiFi networks in our schools: our main WPA network, and an open Guest network. We pushed out a policy with the WPA key to our MacBooks and that seems to get onto the system. However, some computers seem to randomly connect to the open Guest network instead. I've tried creating a policy to push out the info for the Guest network with the "Auto Join" box unckecked, but some system still join this network first.

What can be done to keep computers from auto joining this other network?

We can tell the computers are auto joining it at boot, because when using the "Other" login option, network accounts are unavailable, even though the WiFi is active.

8 REPLIES 8

justinrummel
Contributor III

I assume this is for your OSX clients and not iOS. Take a look at:
[code]networksetup -removepreferredwirelessnetwork[/code]

Chris_Hafner
Valued Contributor II

To solve this issue, we sets a profile with all known SSIDs, but with only the network we wanted set to automatically join. That way, the other networks default to auto join "off".

Chris_Hafner
Valued Contributor II

To solve this issue, we sets a profile with all known SSIDs, but with only the network we wanted set to automatically join. That way, the other networks default to auto join "off".

musat
Contributor III

Thanks, I've been looking into networksetup options, and may need to go that route.

I've tried creating a Configuration Profile with the two WiFi networks defined. I checked the box to auto-join the WPA network and didn't check the box to auto-join the Guest network. However, when the policy gets applied, the computers still default to joining the Guest network. However, when I look at that network setup, the auto-join box is not checked.

Tennant
New Contributor

We deal with this using the networksetup -removepreferredwirelessnetwork command in a login and logout script. For example:

networksetup -removepreferredwirelessnetwork GuestNetworkSSID

EliasG
Contributor

@Tennant how did you write the script?

I just tried a few and have no luck, I am running into the same issue where teachers are using the guest wifi at the schools and we cant push out policies or remote in etc.

EvstersTech
New Contributor

I load the SSID's and turn auto join off but I also put in a bad password to further prevent the connection - the combo of the two has worked well for me.

Sanchi
Contributor

@musat Check out this github: https://gist.github.com/pudquick/fcbdd3924ee230592ab4

My issue similar to yours is that I had a WiFi network set up as a configuration profile but the client Macs would sometimes jump on other WiFi networks in the building. We have 4 internal networks where I work.

The python script by Pudquick stuck my preferred network to the top of the list so the Mac will default to it when searching for a network. Before my preferred network was at the bottom of the list as seems to be the case with WiFi configuration profiles - shouldn't be like that but it is for them moment until Apple make a change.