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).





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

  • I know you don't want to change the channel, but after reading the answers here, it seems to me like the simplest, least hacky solution. – wjandrea Mar 27 '18 at 3:02

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”.

  • 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.

  • 2
    For other MBPs you can find which driver needs patching with the command: sudo kextstat | grep AirPort – Stephen Connolly Oct 8 '14 at 11:57
  • I've got message about invalid kext. Reverted file and touched dir. – k06a Sep 5 '15 at 21:01
  • What if you want the country code to be ES instead? – Fran Marzoa Sep 25 '15 at 20:12
  • Had to disable SIP on 13" Macbook Pro late 2011 to make the change. Even so, it didn't work for me. :( – GAM May 24 '16 at 8:01
  • 1
    doesn't work .. I get : Can't remove /System/Library/Extensions/IO80211Family.kext/Contents/PlugIns/AirPortBrcm4360.kext/Contents/MacOS/AirPortBrcm4360: Operation not permitted, skipping file. – user426132 Jun 7 '17 at 11:11

Easiest solution to conflicting country code - your MAC is picking up the incorrect country code from the 'nearest' broadcasting router.....so if one of your close neighbours has an incorrect country code your own router assumes it is in that 'wrong' country - and it messes up your internet connection - SOLUTION - get an old router that you no longer use - and just plug it into the power supply and place it near to your live router.....make sure your old router is set-up with the correct country code but DO NOT connect it to the internet. Then your MAC will pick up the country code from this 'dummy' router and adopt the correct country code.....problem solved. This appears to work for me, and I have been bugged with this problem for so long.....I live in China and there are about 60 neighbours routers all around my apartment broadcasting many different country codes NIGHTMARE.

Incidentally, this solves one of my problems - but if anyone knows how to beat the Great Firewall and solve the problem of randomly high latency when using VPN that would be a bonus........just be grateful you are not working in China.....its internet is evil.


If you use AirPortBrcm4331 driver on El Capitan:

  1. restart in Recovery mode (CMD+r while booting), open terminal and run csrutil disable
  2. restart, open terminal and run
    • sudo perl -pi -e 's|\x30\x6B\x10\x00\x00\x0F\x85\xEA|\xFF\xFF\x10\x00\x00\x0F\x85\xEA|g' /System/Library/Extensions/IO80211Family.kext/Contents/PlugIns/AirPortBrcm4331.kext/Contents/MacOS/AirPortBrcm4331
    • sudo touch /System/Library/Extensions/
  3. restart in Recovery mode (CMD+r while booting), open terminal and run csrutil enable

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.

  • How did it solve it?, did the country code change? – Ruskes Sep 17 '14 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 '14 at 12:26

I found a slightly bizarre solution. I tried all the solutions Google comes up with, none worked but I saw an article that mentions KisMAC can see channel 13. Installed it and then suddenly my country code changed from US to X3 and now I can connect on channel 13.


All I had to do on my mid 2010 MacBook Pro is to change the kext name from AirPortBrcm4360 to AppleAirPortBrcm43224 and I finally got my location right!


https://github.com/alessandro893/MacOS-WLAN-Driver May be this helps, you can ask author for modifying US country code in os x driver

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .