Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I have problem connecting to a wireless router using Mac OS X which is on channel 13. This is because there is some other router nearby which is broadcasting the US country code. The only way around this i have found so far, is to each time go to the router and restart the computer.

I have asked google and it seems to be a mixture of people who think that it is setting the locale changes it, or that it is fixed in the router firmware. Both i have shown to be wrong. man ifconfig also has not been too enlightening.

Does anyone know of another way to force the card to use a different country Code or channels? I would rather not change to another channel, as there is alot of interference near by (shown with KisMAC).

Thanks


Edits

Found

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

Which appears to allow for an arbitary channel to be set on the card, but not county code. This seems to have no effect.

share|improve this question

3 Answers 3

802.11d is the protocol that wireless access points use to broadcast (among other things) the regulatory domain (i.e. country codes) in which it is supposed to be operating. It seems that there may be no clear rule for what to do when various equipment is broadcasting conflicting regulatory domain information.

The ideal solution would be to disable/replace/reconfigure the equipment that is broadcasting the incorrect information.

I found an (oldish) Apple Discussions thread that indicates that indicates that a Mac’s AirPort hardware will use the first country code it hears after powering on or waking from sleep. Later postings in the thread (on the second page) indicate that it is sufficient to just power off/on the AirPort hardware itself and not the whole system. A couple of people reported success using a script to repeatedly turn the AirPort interface off and on (using networksetup) until it happened to acquire the desired state (as reported by system_profiler).


Based on TA25972, it seems that older equipment (presumably models that do not listen for 802.11d information) may not even be able to switch “country codes”.

share|improve this answer
    
Unfortunaly i don't have access to the wireless router which is broadcasting the wrong country code. I had seen that discussion thread before, but the room i am in is quite far from the correct router and every reboot there seems to find the US broadcasting router. interestingly though, KisMAC says it can detect routers on channel 13, even when the country code is set to US. So i may look into that later. –  Twig Mar 8 '11 at 15:58
1  
I have check this again today and KisMAC is able to find my router and identify that it is on channel 13 despite having the country code as US and 13 not being in the list of supported channels –  Twig Mar 8 '11 at 17:38

I got this problem to, and I solved it!

All I wanted to do is to disable the 802.11d beacon function. This is impossible to do in any available settings on the Mac OS X.

However you can binary patch the network card driver thinking the country code is always X2.

So apparently, what I would have to do is change/binary patch the network driver with the string 0x81 0x78 0x30 0x6B 0x10 0x00 0x00 0x0F 0x85 to 0x81 0x78 0x30 0x6B 0x10 0x00 0x00 x90 0xE0. This forces the driver to use country code «X2» whatever beacon is being sent, so it will never change.

You could either change this with a hex-editing utility or copy and paste the following very handy one-liner in the terminal application:

sudo perl -pi -e 's|\x81\x78\x30\x6B\x10\x00\x00\x0F\x85|\x81\x78\x30\x6B\x10\x00\x00\x90\xE9|' /System/Library/Extensions/IO80211Family.kext/Contents/PlugIns/AirPortBrcm4360.kext/Contents/MacOS/AirPortBrcm4360 && sudo touch /System/Library/Extensions/

This solution works for Mac Book Pro Retina 2013.

share|improve this answer
    
For other MBPs you can find which driver needs patching with the command: sudo kextstat | grep AirPort –  Stephen Connolly Oct 8 at 11:57

I had a similar problem with my wifi router but when I set the router to 5 ghz and the channel to auto the problem was solved.

share|improve this answer
    
How did it solve it?, did the country code change? –  Buscar웃 Sep 17 at 15:05
    
No Buscar, the country code on the wifi device in my vicinity did not change, at least so far as I could tell,as soon as I swapped over from 2.4 GHZ to 5 GHZ and set my router to auto select the strongest channel it could poll, I found the problem resolved and if I swapped back to 2.4 GHZ then the foreign country code cropped up again and proved to be a problem to my iMac's internal wifi card getting a connection to the Internet. Wi-Fi Diagnostics Tool advised of the country code problem. Swapped back to 5GHZ and auto select best channel pollable and problem removed. –  Peter Boocock Sep 18 at 12:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.