I want to increase my txpower to 30 with iwconfig, but it is not working.

The rts and ths are not on off mode:

Mode:Managed  Access Point: Not-Associated   Tx-Power=20 dBm   
          Retry short limit:7   **RTS thr=2347 B**   Fragment thr:off
          Encryption key:off
          Power Management:on

I tried these commands:

iw reg set BO
iwconfig wlan0 txpower 30

ifconfig wlan0 down
iw reg set BO

ifconfig wlan0 up
iwconfig wlan0 channel 13

iwconfig wlan0 txpower 30

But these didn't work for me. How do I set the txpower?

  • Does your device support this? Have done it with other operatinf sustems on the same hardware? – 0xSheepdog Dec 19 '17 at 14:58

First, check if your wireless NIC supports increasing txpower thing or not.

But, If it supports then, have a look on some hacks below, that I did.

First let me point out that I am not doing anything illegal with my Wi-Fi and unlocking different power output is strictly for some internal tests. I know about my country's wireless power limit.

There are two protections that your Wi-Fi has to limit its maximum power output to a legal value (100mW for example). First is the Wi-Fi interface internal HW limit. But if you buy a Wi-Fi adapter designed for a market of the different country, this limit can be higher (500mW for the USA). However if your Linux computer knows internally in what country it is located, then another layer of protection is inside the Linux kernel. But, you can circumvent the Linux kernel Wi-Fi limits per-country.

I have Alfa AWUS036H wireless card.

You can use iwconfig or there are lots of tutorials or guides on google to help you out.

Once, I tried it, some 1 or 2 years ago. And, It didn't increase.Then, after searching a lot, I found that some countries have limitations on txpower in wireless.

Even, if you able to increase it via iwconfig or something else, then again after unplugging wireless card, it comes back to its original value.

So, you need to change some values in the regulatory database and then recompile the CRDA package and generate the new modified binary.

First, check what are the current values in your country and to what extent power will increase. Using this iw reg get in terminal you will get that.

Note that all the levels are maximized on 20db, what is 100mW, this is visible in the (3, 20). This means that despite that my Wi-Fi can go up to 1W (30db) or 500mW (27db), I can only set values from 1 to 20 and if I try to enter a higher value, I will get an error.

Now, you need to install python-m2crypto package and also download the source code for regulatory database and for crda regulatory package.

Unpack regulatory database source code package and enter into the directory. Now, let's move to the regulatory database, itself. The database is actually stored as a text file called db.txt and it contains a lot of countries and for each country a specific level of power protection.

What you can do with this db.txt is to either edit the country you are in (based on the iw reg get command), or you can create your own country.

For example, I am editing country 00 (this is based on iw reg get command)

country 00:
    (2402 - 2494 @ 40), (N/A, 30)
    (4910 - 5235 @ 40), (N/A, 30)

This basically overrides all the “PASSIVE-SCAN” and “NO-IBSS” limits and also upgraded the limits to 30db for each frequency.

Now, we have our custom regulatory database created, we have to generate it in binary format for the Linux kernel.

Do, make -j$(nproc) && make install.

Now, goto CRDA package and extract it, and in above process, two public keys will generate in a wireless-regdb directory. So, copy both public keys into crda.x.x.x/pubkeys.

Now, let's compile and install regulatory database (crda package) with make -j$(nproc) && make install.

Final, Reboot & Test it.

After reboot, check for power iw reg get.

And now, you will be able to manipulate the power output with the iwconfig wlan<x> txpower <number> command.

Note: Enjoy, But please note that doing this is a violation of regulatory laws in most countries, so do this only for lab/test environment.

| improve this answer | |

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.