First, check if your wireless NIC supports increasing txpower thing or not.
Mas, se ele suportar então, dê uma olhada em alguns hacks abaixo, o que eu fiz.
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.
Observação: aproveite, mas observe que isso é uma violação das leis de regulamentação na maioria dos países, portanto, faça isso apenas para o ambiente de laboratório / teste.