Force connect to WiFi channel

I am not tech savvy. I am staying at a hotel, I have an old MacBook Air and it has very bad problems getting WiFi here. I used Wireless Diagnostics, the hotel has different WiFi channels, I also used the option key plus clicking on the WiFi icon in the menu bar to see what’s going on. I can sometimes get WiFi if I keep forgetting the network in system preferences and/or turning off the WiFi and then turning it back on but I only get it for a few minutes. The WiFi always reverts to this channel (channel 11) that doesn’t work on my computer. I have seen the other channels work on my computer. I am not knowledgeable about programming, I wanted to try to make my computer automatically stay connected to a certain channel through Terminal but it didn’t work. I’m not sure if I entered the command right. Also I want to make sure I can set the WiFi back to normal when I leave here. I want to connect to channel 1, also there is another channel DFS, 140 that is 5 ghz and works faster but doesn’t seem to always work. This is the command I found online. I wasn’t clear if I was supposed to type sudo and then hit return and then type the rest of the command. I also wasn’t sure if I just type in this command when I open Terminal and it shows my name plus the $ sign or if I need to type anything else first and if I’m supposed to type exit after entering the command. Also like I said, I want to be able to set the WiFi back to normal when I leave here and I don’t know how I would do that either. Can anyone help with this? Thanks.




MacBook Air 13″, macOS 11.6

Posted on May 31, 2022 3:32 PM

Reply
Question marked as Top-ranking reply

Posted on Jun 2, 2022 6:58 PM

fantazal wrote:

Thanks for the information. When you say the last command will set an arbitrary WiFi channel, I’m not sure if you meant the command I shared a screenshot of?

Yes.


So when I leave here, I can just put that command in and it will connect me to whatever WiFi network there is wherever I’m staying?

The command I provided you would (in theory) change the Wi-Fi channel your notebook's AirPort will use to attempt to connect to a Wi-Fi network that is using that channel. I gave you an example of that command to set it to "62." You would just need to set the number to whatever channel you believe the hotel's Wi-Fi is configured for that you want to connect to. This should not be a permanent change ... only for this connection.


I do know the channels here that work on my computer. Also, a few of them start with DFS, and then the number of the channel so I don’t know if I need to include that in the command, including the comma.

No, You should only need to enter the channel number. Do not add "DFS" or a comma.


When I tried typing sudo In -s in Terminal, it asked me for my password, I’m assuming it meant the password I use to log in to my computer on,

The "sudo" command elevates the command to the administrator-level. This level is required to allow this particular command to work. The password would be the one that is used with the user account (on this Mac) with Administrator privileges. If you only have one account on this device, the account that you log in on should be an Administrator-level account.


I entered that but then it said

sudo: In: command not found

Be sure copy and paste the whole command that I provided you ... not just the "sudo ln" part at the command prompt in the Terminal app.

Similar questions

7 replies
Question marked as Top-ranking reply

Jun 2, 2022 6:58 PM in response to fantazal

fantazal wrote:

Thanks for the information. When you say the last command will set an arbitrary WiFi channel, I’m not sure if you meant the command I shared a screenshot of?

Yes.


So when I leave here, I can just put that command in and it will connect me to whatever WiFi network there is wherever I’m staying?

The command I provided you would (in theory) change the Wi-Fi channel your notebook's AirPort will use to attempt to connect to a Wi-Fi network that is using that channel. I gave you an example of that command to set it to "62." You would just need to set the number to whatever channel you believe the hotel's Wi-Fi is configured for that you want to connect to. This should not be a permanent change ... only for this connection.


I do know the channels here that work on my computer. Also, a few of them start with DFS, and then the number of the channel so I don’t know if I need to include that in the command, including the comma.

No, You should only need to enter the channel number. Do not add "DFS" or a comma.


When I tried typing sudo In -s in Terminal, it asked me for my password, I’m assuming it meant the password I use to log in to my computer on,

The "sudo" command elevates the command to the administrator-level. This level is required to allow this particular command to work. The password would be the one that is used with the user account (on this Mac) with Administrator privileges. If you only have one account on this device, the account that you log in on should be an Administrator-level account.


I entered that but then it said

sudo: In: command not found

Be sure copy and paste the whole command that I provided you ... not just the "sudo ln" part at the command prompt in the Terminal app.

Jun 1, 2022 2:01 PM in response to fantazal

The last command in Terminal will set an arbitrary Wi-Fi channel on your Mac's AirPort wireless card. You should not need to reset it.


To use it, you would need to know what channel that you want your Mac to use for the Wi-Fi connection.


I repeated it again for you. In my example, I will be assuming that you need to change the channel to 62. Open the Terminal app, and then, copy & paste the following line at the Terminal's command prompt. Then press the enter key. Type exit at the prompt, and then, press the enter key, to close the Terminal window.


sudo ln -s

/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport

/usr/sbin/airport --channel=62



Jun 1, 2022 3:10 AM in response to fantazal

There's nothing special, usually, about connecting to a commercial network. In fact, most are unsecured and are easier than a secured network. But you might have to ask the networks administrator/owner what exactly is needed. They all vary depending on who set it up initially. You should be able to see all the available networks by opening System Preferences > Network. Usually there will be a network that's named sort of like wherever your location/motel/hotel/conference is.


After picking out a network, I open my browser and try to surf. That prompts a message from the location's network with instructions you have to follow.


If that doesn't happen, you'll need to talk to the administrator or owner to get the proper login credentials.

Jun 1, 2022 9:34 AM in response to ku4hx

Yes, the hotel has a WiFi network. The hotel network shows if I click the WiFi icon in my menu bar and yes, it also shows if I open Network in System Preferences. That is not the thing. I’m not sure the exact terminology how to word this but there are four different channels on the WiFi in this hotel, my

computer for some reason always reverts to the channel that doesn’t work on my computer; the rest of the channels work, at least part of the time. I wanted to set my computer to automatically connect to one of the channels that does work. The hotels technical support can’t help me with this, I already have spoken to them.

Jun 1, 2022 9:56 AM in response to fantazal

This will really depend on the Strength of the Signal being broadcast from the Wifi in the Hotel and your proximity to the Access point.


If the Access Point is down the hall - the Broadcast signal will be weak at best. Also, if the Access Point is set to Broadcast in the 2.4 ghz band this will generate Walls and other object better than the 5 ghz band.


As for the channels the access point is broadcasting - that and all the above are out of your control

Jun 1, 2022 1:03 PM in response to Owl-53

The channels the access point is broadcasting are out of my control but this page online said you can set your computer to automatically connect to a certain channel on the network, that is what I was trying to do, I want set my computer to automatically connect to one of the channels that works, not to the one that never works. I am not a programmer so I was uncertain about typing the command in terminal and if i was able to do it, I also don’t know how to set it back to normal when I leave here. It looks like after typing sudo, I am supposed to leave a space or two before typing the rest of the command and if the command works, I’m also not sure if I am supposed to then type exit and hit return.


Jun 2, 2022 1:38 PM in response to Tesserax

Thanks for the information. When you say the last command will set an arbitrary WiFi channel, I’m not sure if you meant the command I shared a screenshot of? So when I leave here, I can just put that command in and it will connect me to whatever WiFi network there is wherever I’m staying? I do know the channels here that work on my computer. Also, a few of them start with DFS, and then the number of the channel so I don’t know if I need to include that in the command, including the comma.


When I tried typing sudo In -s in Terminal, it asked me for my password, I’m assuming it meant the password I use to log in to my computer on, I entered that but then it said


sudo: In: command not found


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Force connect to WiFi channel

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.