Improve TX Power by changing the CRDA Regulatory Domain on Ubuntu & BackTrack
(for ALFA-AWUS036H 500mW/1.000mW with RTL8187/mac80211)
With the introduction of new drivers Stacks mac80211, unlike previous ieee80211, the TX-Power is adjusted/set automatically by CRDA.
Therefore is not longer possible to use the ALFA-AWUS036H USB wireless adapter (chipset Realtek RTL8187L)
with all his power for Wireless connections or during Wardriving.
By analyzing the structure of new configuration of mac80211 files and "udev" recall to the Linux Kernel, we can circumvent the obstacle by adjusting the strength of TX-Power of our Wireless card acting on the CRDA. (Central Regulatory Domain Agent)
Remember, that modification of CRDA, not only affects the settings of the maximum usable/permit power (dBm), but also setup the channels of frequencies/band allocated for the Wireless trasmission, which are set globally and for each Country by specific Laws Regulations, so make sure not to violate the Laws
of your Country using frequencies or tx-powers not allowed.
After this brief introducion, we see how to permit the full output power of your wireless card, opting for either
of these two
solutions.
NOTE:
- The creation and editing of the following files must be done carefully.
- Tested on Ubuntu Jaunty - Kernel 2.6.28 and 2.6.30.
- Tested on BackTrack 4 and 5.
- Compatible with latest Ubuntu version only after making some changes to the procedures described below.
- Make sure not to violate the Laws of your Country using frequencies or power (Tx Powers) not permitted.
Update your OS and install these ESSENTIAL and recommended package
NOTE:
Before continuing, make sure NOT to be active in Synaptic the Repositories "Proposed" and "Backports"
Code:
sudo dpkg --configure -a && sudo apt-get install -f && sudo apt-get update
Code:
sudo apt-get install linux-headers-$(uname -r) build-essential make patch subversion openssl libssl-dev zlib1g zlib1g-dev libssh2-1-dev libnl1 libnl-dev gettext autoconf tcl8.5 libpcap0.8 libpcap0.8-dev python-scapy python-dev cracklib-runtime macchanger-gtk tshark ethtool
Install/update "IW"
(Wireless Configuration Utility for drivers based on Stacks-mac80211)
[Firt option] Install iw from Ubuntu Repository
Code:
sudo apt-get install iw
[RECOMMENDED OPTION] Alternatively compiling the latest version available from IW source
Code:
sudo mkdir /usr/src/drivers && cd /usr/src/drivers
sudo wget http://linuxwireless.org/download/iw/iw-3.4.tar.bz2 -O - | sudo tar -jxv
cd iw*
sudo make && sudo make install
FIRST OPTION
Shortcuts to change to 30 dBm the CRDA with a single command
If you use more than one Wireless adapter is convenient to change automatically the CRDA when you need and only
for your ALFA-AWUS036H usb card.
Therefore, this first option is recommended to simplify but not permanently change the default data of your System.
Create a new file using your favorite text editor, called "crda_change"
"
Code:
sudo gedit /usr/local/bin/crda_change
Copy & paste in the new file created this text
Code:
#!/bin/sh
sudo modprobe rtl8187
sleep 2
sudo iw reg set BO
Make file executable
Code:
sudo chmod +x /usr/local/bin/crda_change
Make a copy of Backup of the original file and create a new alias, in the example named --> boost
Code:
cp ~/.bashrc .bashrc_backup
Code:
printf "alias boost=\'sudo /usr/local/bin/crda_change'\n" | tee -a ~/.bashrc
Now close your shell session, and if you want load the driver RTL8187/mac80211 and change automatically the CRDA
use boost
command in new terminal
Second Option
Option to automate the modification of the CRDA, and put in "mode UP" your ALFA-AWUS036H when you plugged in to the USB port
Create a new file called "crda_change" as described in the previous step --> FIRST OPTION
Create, or if it already exists, edit the following file
Code:
sudo gedit /etc/udev/rules.d/80programs.rules
Copy and paste the following text
NOTE:
the text, when pasted, must be represented on one line
Code:
SUBSYSTEMS=="usb", SYSFS{idVendor}=="0bda", SYSFS{idProduct}=="8187", RUN+="/usr/local/bin/crda_change"
Now, when connecting the usb WiFi adapter into the USB port, the script will run automatically to allow the adjustment of the TX-Power of your usb card connected.
Basic Linux commands to check the CRDA and set the output power (tx power) using IW
To check the current level of output power settings (tx power level)
Code:
iwlist wlan0 txpower | grep "Current"
The use of IW to check the Regulatory Domain settings currently in use by your Kernel
Code:
iw reg get
The use of IW to verify the frequencies and output powers allowed by change the regulatory domain settingsthe current CRDA
Code:
iw phy0 info | fgrep MHz
The use of IW to setting the output power level to 1.000mW/3000mBm (txpower output)
Code:
sudo iw dev wlan0 set txpower fixed 3000
Important note regarding the use of IW:
If you use the new configuration utility for Wireless device "IW" instead of "IWCONFIG", remember that the parameters for setting the output power level be expressed in mBm
(millibels referenced to 1 milliwatt) and lo longer in dBm
(decibels referenced to 1 milliwatt), therefore the scale is as follows: -> 100 mBm = 1 dBm.
Test on Ubuntu

Test on BackTrack 5
Enjoy, Jano
Written: 22/Mar/2010
Updated: 15/May/2012
Disclaimer