Based on this question, pastebin here. (I deleted all the other available network connections in the area, as well as previously saved connections in that text file)

I've had Ubuntu 14.04 on this laptop for a while, and had previously had some difficulty connecting to the network at school, but had usually blamed that on the school wifi itself, since it was highly location dependent. I'm travelling in Brazil at the moment and have managed to occasionally successfully connect to my host's network. My Android phone has no trouble connecting (I'm writing this by tethering my computer through USB to my phone). Most of the time the computer just attempts to connect, then either asks me to reenter the password, and then stays disconnected.

  • I'm in Brazil at the moment – raphael Jun 23 '15 at 13:43
  • I have included instructions to properly set your CRDA for use in Bazil only. – mchid Jun 23 '15 at 15:47
  • It's possible the wifi channel is broadcasting on either channels 2467 or 2472 which are not restricted in Brazil but are not permitted when using the default world regdom which only includes frequencies from 2412 up to 2462. By properly setting the regdom for Brazil you will be permitted to access these restricted frequencies which are fully legal within Brazil. Even though these frequencies show enabled, you also show the country as 00 which is for world which may override your local time zone domain. Setting to BR instead should correct this. – mchid Jun 23 '15 at 15:54

There are a couple of things you can do that help when connecting to unresponsive networks.

First, increase your retry from a conservative 7 up to somewhere between 10 or 14. Run the following command in a terminal. Assuming your wireless device is wlan0:

sudo iwconfig wlan0 retry 12

or for wlan1:

sudo iwconfig wlan1 retry 12

Then refresh network-manager:

sudo service network-manager restart

Next, make sure you have ports 67 and 68 open for DHCP traffic and ports 52 and 53 for DNS. There are many ways to accomplish this. For testing purposes, you can disable the firewall using the following command:

sudo ufw disable

You can use ufw to open these ports. See:

man ufw

Another option is to use the user friendly gui version of ufw, gufw.

To install:

sudo apt-get update
sudo apt-get install gufw

gufw is pretty straightforward.


Finally, you may be experiencing some restrictions set by the most restrictive world regulatory domain default Ubuntu has set by default. Please be aware that using the wrong regulatory code may result in fines or punishment so only use the proper code that corresponds to the country or nation the computer is currently bieng used in and if you leave the country, you MUST change the code accordingly or use the default world regulatory domain instead which is legal and valid in all nations and countries.

For use inside Brazil ONLY!! execute the following command to apply local wireless restrictions:

sudo iw reg set BR

To make this setting permanent, you can set the regulatory domain in your /etc/default/crda file by running the following command. Again, this is for Brazil ONLY:

sudo sed -i 's/REGDOMAIN=/REGDOMAIN=BR/g' /etc/default/crda 

Finally, if you ever leave the country and need to change this back to the default world regulatory domain, run the following command and then reboot:

sudo sed -i 's/REGDOMAIN=BR/REGDOMAIN=/g' /etc/default/crda

Click here for a list of codes used for other countries (US, for example, is used for United States).

  • Good intuition on the Country Regulatory Domain. Went through step by step, testing each in turn, and modifying /etc/default/crda is what worked. Thanks! – raphael Jun 23 '15 at 20:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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