There are two protections that your Wi-Fi has to limit it’s 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 different country, this limit can be higher (500mW for USA, or even 1W for Chille). However if your linux computer knows internally in what country it is located, then another layer of protection is inside the linux kernel. In this post I will show you how to circumvent the linux kernel Wi-Fi limits per-country.
The story
First let me point out that I am not doing anything ilegal with my Wi-Fi and unlocking different power output is strictly for some internal tests. I am also doing all this on our weekend house quite far from civilization so I am not harming anybody by distorting surrounding Wi-Fi signals. Also, if I go from default limit of 100mW on 2.4Ghz to 500mW on 2.4Ghz, I am not even going beyond the legal 500mW limit that is legal in my country for 5Ghz Wi-Fi signals. So I am quite sure that 500mW is not harmful to anyone.
What do we need to get beyond 100mW limit
First, you will need a Wi-Fi adapter that doesn’t have an internal limiting, the most simple method is to buy an adapter on ebay.com that is targeted for a different market country where the limits are higher. It is no problem to buy a Wi-Fi adapter with limits of the USA that are 500mW, but maybe you can get lucky and buy something that can go up to 1W as an adapter targeting countries like Chille.
I have personally bought Alfa AWUS036NEH adapter that can go 1000mW (1W) and you can pretty much get this thing on Amazon.com. Below is a picture how it looks like.
Then the only other thing you need is a PC with linux installed that we will be creating the custom regulatory database to. I am personally using the BackTrack 5r3 distribution, but this is ubuntu based distro so you should be capable of following the guide on any debian/ubuntu-like distro.
First, it is a good idea to see if you are actually limited already. You can check this with command iw reg get as shown below.
In my particular instance, the country is not provided, so the system went back to “safe default” and inserted country 00. This non-existent country has the most restrictive transmission levels on all possible country spectrum. 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 cart can go up to 1W (30db) or 500mW (27db), I can only set values from 1 to 20 and if I try to enter higher value, I will get an error.
[themify_quote]root@parasite:~# iwconfig wlan0 wlan0 IEEE 802.11bgn ESSID:off/any Mode:Managed Access Point: Not-Associated Tx-Power=20 dBm Retry long limit:7 RTS thr:off Fragment thr:off Encryption key:off Power Management:on
root@parasite:~# iwconfig wlan0 txpower 27 Error for wireless request “Set Tx Power” (8B26) : SET failed on device wlan0 ; Invalid argument.[/themify_quote]
This is the limit that we would like to avoid so that we can configure txpower fo 27 or 30.
Step 1. Gathering all components for a new regulatory database
First have apt-get install you a few needed packages by using the apt-get command. Most of these will already be installed, but this is good to be sure to check.
Unpack the wireless-regdb_2009.11.25.orig.tar.bz2 and enter the new directory wireless-regdb_2009.11.25. Inside, first open the db2bin.py file and change the first line from:
This will enable you to compile the database with the newer python2 package.
Now, lets 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 levels of power protection like this for the generic country 00.
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. In this example, I will be creating editing the default country 00 because my system thinks this is the country I am in. I have edited country 00 like this:
Ok, Step 1 is to extract the package with command like tar -xvf ./crda-1.1.3.tar.bz2, then edit the python script for creating the directory for the newer python version. This is the same that we did before in Step 2.
BEFORE:
root@parasite:~# head -1 ./crda-1.1.3/utils/key2pub.py #!/usr/bin/env python
AFTER:
root@parasite:~/custom_regulatory2# head -1 ./crda-1.1.3/utils/key2pub.py #!/usr/bin/python2
There are two protections that your Wi-Fi has to limit it’s 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 different country, this limit can be higher (500mW for USA, or even 1W for Chille). However if your linux computer knows internally in what country it is located, then another layer of protection is inside the linux kernel. In this post I will show you how to circumvent the linux kernel Wi-Fi limits per-country.
First let me point out that I am not doing anything ilegal with my Wi-Fi and unlocking different power output is strictly for some internal tests. I am also doing all this on our weekend house quite far from civilization so I am not harming anybody by distorting surrounding Wi-Fi signals. Also, if I go from default limit of 100mW on 2.4Ghz to 500mW on 2.4Ghz, I am not even going beyond the legal 500mW limit that is legal in my country for 5Ghz Wi-Fi signals. So I am quite sure that 500mW is not harmful to anyone.
What do we need to get beyond 100mW limit
First, you will need a Wi-Fi adapter that doesn’t have an internal limiting, the most simple method is to buy an adapter on ebay.com that is targeted for a different market country where the limits are higher. It is no problem to buy a Wi-Fi adapter with limits of the USA that are 500mW, but maybe you can get lucky and buy something that can go up to 1W as an adapter targeting countries like Chille.
I have personally bought Alfa AWUS036NEH adapter that can go 1000mW (1W) and you can pretty much get this thing on Amazon.com. Below is a picture how it looks like.
Then the only other thing you need is a PC with linux installed that we will be creating the custom regulatory database to. I am personally using the BackTrack 5r3 distribution, but this is ubuntu based distro so you should be capable of following the guide on any debian/ubuntu-like distro.
Step by Step guide to change regulatory database
The following steps should be followed, I will try to explain each step to the best of my abilities.
Step 0. Check you current regulatory database limits for your country
First, it is a good idea to see if you are actually limited already. You can check this with command iw reg get as shown below.
In my particular instance, the country is not provided, so the system went back to “safe default” and inserted country 00. This non-existent country has the most restrictive transmission levels on all possible country spectrum. 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 cart can go up to 1W (30db) or 500mW (27db), I can only set values from 1 to 20 and if I try to enter higher value, I will get an error.
This is the limit that we would like to avoid so that we can configure txpower fo 27 or 30.
Step 1. Gathering all components for a new regulatory database
First have apt-get install you a few needed packages by using the apt-get command. Most of these will already be installed, but this is good to be sure to check.
Unpack the wireless-regdb_2009.11.25.orig.tar.bz2 and enter the new directory wireless-regdb_2009.11.25. Inside, first open the db2bin.py file and change the first line from:
1
#!/usr/bin/env python
to
1
#!/usr/bin/python2
This will enable you to compile the database with the newer python2 package.
Now, lets 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 levels of power protection like this for the generic country 00.
1
2
3
4
5
6
7
8
9
10
11
country00:
(2402–2472@40),(3,20)
# Channel 12 – 13. No HT40 channel fits here
(2457–2482@20),(3,20),PASSIVE–SCAN,NO–IBSS
# Channel 14. Only JP enables this and for 802.11b only
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. In this example, I will be creating editing the default country 00 because my system thinks this is the country I am in. I have edited country 00 like this:
1
2
3
country00:
(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.
Step 3. Compilation & Install
Ok, now we have our custom regulatory database created, we have to generate it in binary format for the linux kernel.
1
2
3
4
5
6
7
8
9
10
11
12
root@parasite:~/custom_regulatory/wireless–regdb–2009.11.25# make
Ok, Step 1 is to extract the package with command like tar -xvf ./crda-1.1.3.tar.bz2, then edit the python script for creating the directory for the newer python version. This is the same that we did before in Step 2.
BEFORE:
1
2
AFTER:
1
2
root@parasite:~/custom_regulatory2# head -1 ./crda-1.1.3/utils/key2pub.py
#!/usr/bin/python2
Now for the new CRDA package, we need the public keys we compiled previously. So copy the two public keys from the wireless-regdb to crda-1.1.3/pubkeys directory.
Мы используем файлы cookie на нашем веб-сайте, запоминая ваши предпочтения и повторные посещения. Нажимая «Принять», вы соглашаетесь на использование ВСЕХ файлов cookie.
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
Cookie
Duration
Description
cookielawinfo-checbox-analytics
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checbox-functional
11 months
The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checbox-others
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-necessary
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-performance
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy
11 months
The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Мар 15 2017
How to create custom Linux Wi-Fi regulatory database to unlock 30db/1000mW
There are two protections that your Wi-Fi has to limit it’s 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 different country, this limit can be higher (500mW for USA, or even 1W for Chille). However if your linux computer knows internally in what country it is located, then another layer of protection is inside the linux kernel. In this post I will show you how to circumvent the linux kernel Wi-Fi limits per-country.
The story
First let me point out that I am not doing anything ilegal with my Wi-Fi and unlocking different power output is strictly for some internal tests. I am also doing all this on our weekend house quite far from civilization so I am not harming anybody by distorting surrounding Wi-Fi signals. Also, if I go from default limit of 100mW on 2.4Ghz to 500mW on 2.4Ghz, I am not even going beyond the legal 500mW limit that is legal in my country for 5Ghz Wi-Fi signals. So I am quite sure that 500mW is not harmful to anyone.
What do we need to get beyond 100mW limit
First, you will need a Wi-Fi adapter that doesn’t have an internal limiting, the most simple method is to buy an adapter on ebay.com that is targeted for a different market country where the limits are higher. It is no problem to buy a Wi-Fi adapter with limits of the USA that are 500mW, but maybe you can get lucky and buy something that can go up to 1W as an adapter targeting countries like Chille.
I have personally bought Alfa AWUS036NEH adapter that can go 1000mW (1W) and you can pretty much get this thing on Amazon.com. Below is a picture how it looks like.
Then the only other thing you need is a PC with linux installed that we will be creating the custom regulatory database to. I am personally using the BackTrack 5r3 distribution, but this is ubuntu based distro so you should be capable of following the guide on any debian/ubuntu-like distro.
First, it is a good idea to see if you are actually limited already. You can check this with command iw reg get as shown below.
root@parasite:~# iw reg get
country 00:
(2402 - 2472 @ 40), (3, 20)
(2457 - 2482 @ 20), (3, 20), PASSIVE-SCAN, NO-IBSS
(2474 - 2494 @ 20), (3, 20), NO-OFDM, PASSIVE-SCAN, NO-IBSS
(5170 - 5250 @ 40), (3, 20), PASSIVE-SCAN, NO-IBSS
(5735 - 5835 @ 40), (3, 20), PASSIVE-SCAN, NO-IBSS
In my particular instance, the country is not provided, so the system went back to “safe default” and inserted country 00. This non-existent country has the most restrictive transmission levels on all possible country spectrum. 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 cart can go up to 1W (30db) or 500mW (27db), I can only set values from 1 to 20 and if I try to enter higher value, I will get an error.
[themify_quote]root@parasite:~# iwconfig wlan0wlan0 IEEE 802.11bgn ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=20 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:on
root@parasite:~# iwconfig wlan0 txpower 27
Error for wireless request “Set Tx Power” (8B26) :
SET failed on device wlan0 ; Invalid argument.[/themify_quote]
This is the limit that we would like to avoid so that we can configure txpower fo 27 or 30.
Step 1. Gathering all components for a new regulatory database
First have apt-get install you a few needed packages by using the apt-get command. Most of these will already be installed, but this is good to be sure to check.
[themify_quote]apt-get install python-m2crypto[/themify_quote]Secondly, download source code for the regulatory database (debian version) here, or via backup link.
Thirdly, you will also need the crda regulatory package here, or via backup link.
Step 2. Editing the files before compilation
Unpack the wireless-regdb_2009.11.25.orig.tar.bz2 and enter the new directory wireless-regdb_2009.11.25. Inside, first open the db2bin.py file and change the first line from:
[themify_quote]#!/usr/bin/env python[/themify_quote]on
[themify_quote]#!/usr/bin/python2[/themify_quote]This will enable you to compile the database with the newer python2 package.
Now, lets 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 levels of power protection like this for the generic country 00.
[themify_quote]country 00:(2402 – 2472 @ 40), (3, 20)
# Channel 12 – 13. No HT40 channel fits here
(2457 – 2482 @ 20), (3, 20), PASSIVE-SCAN, NO-IBSS
# Channel 14. Only JP enables this and for 802.11b only
(2474 – 2494 @ 20), (3, 20), PASSIVE-SCAN, NO-IBSS, NO-OFDM
# Channel 36 – 48
(5170 – 5250 @ 40), (3, 20), PASSIVE-SCAN, NO-IBSS
# NB: 5260 MHz – 5700 MHz requies DFS
# Channel 149 – 165
(5735 – 5835 @ 40), (3, 20), PASSIVE-SCAN, NO-IBSS[/themify_quote]
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. In this example, I will be creating editing the default country 00 because my system thinks this is the country I am in. I have edited country 00 like this:
[themify_quote]country 00:(2402 – 2494 @ 40), (N/A, 30)
(4910 – 5235 @ 40), (N/A, 30)[/themify_quote]
Step 3. Compilation & Install
Ok, now we have our custom regulatory database created, we have to generate it in binary format for the linux kernel.
[themify_quote]root@parasite:~/custom_regulatory/wireless-regdb-2009.11.25# makeGenerating private key for root…
openssl genrsa -out ~/.wireless-regdb-root.key.priv.pem 2048
Generating RSA private key, 2048 bit long modulus
……………………………………+++
……………………………………………………………………………………….+++
e is 65537 (0x10001)
Generating public key for root…
openssl rsa -in ~/.wireless-regdb-root.key.priv.pem -out root.key.pub.pem -pubout -outform PEM
writing RSA key
Generating regulatory.bin digitally signed by root…
./db2bin.py regulatory.bin db.txt ~/.wireless-regdb-root.key.priv.pem[/themify_quote]
And then make install
[themify_quote]root@parasite:~/custom_regulatory/wireless-regdb-2009.11.25# make installgzip < regulatory.bin.5 > regulatory.bin.5.gz
install -m 755 -d //usr/lib/crda
install -m 755 -d //usr/lib/crda/pubkeys
if [ -f .custom ]; then \
install -m 644 -t //usr/lib/crda/pubkeys/ root.key.pub.pem; \
fi
install -m 644 -t //usr/lib/crda/pubkeys/ linville.key.pub.pem
install -m 644 -t //usr/lib/crda/ regulatory.bin
install -m 755 -d //usr/share/man//man5/
install -m 644 -t //usr/share/man//man5/ regulatory.bin.5.gz[/themify_quote]
Step 4. CRDA
Ok, Step 1 is to extract the package with command like tar -xvf ./crda-1.1.3.tar.bz2, then edit the python script for creating the directory for the newer python version. This is the same that we did before in Step 2.
BEFORE:
root@parasite:~# head -1 ./crda-1.1.3/utils/key2pub.py
#!/usr/bin/env python
AFTER:
root@parasite:~/custom_regulatory2# head -1 ./crda-1.1.3/utils/key2pub.py
#!/usr/bin/python2
How to create custom Linux Wi-Fi regulatory database to unlock 30db/1000mW
By
Peter Havrila– September 10, 2013Posted in: Home Networking, Linux, Networking
There are two protections that your Wi-Fi has to limit it’s 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 different country, this limit can be higher (500mW for USA, or even 1W for Chille). However if your linux computer knows internally in what country it is located, then another layer of protection is inside the linux kernel. In this post I will show you how to circumvent the linux kernel Wi-Fi limits per-country.
Contents [hide]
The story
First let me point out that I am not doing anything ilegal with my Wi-Fi and unlocking different power output is strictly for some internal tests. I am also doing all this on our weekend house quite far from civilization so I am not harming anybody by distorting surrounding Wi-Fi signals. Also, if I go from default limit of 100mW on 2.4Ghz to 500mW on 2.4Ghz, I am not even going beyond the legal 500mW limit that is legal in my country for 5Ghz Wi-Fi signals. So I am quite sure that 500mW is not harmful to anyone.
What do we need to get beyond 100mW limit
First, you will need a Wi-Fi adapter that doesn’t have an internal limiting, the most simple method is to buy an adapter on ebay.com that is targeted for a different market country where the limits are higher. It is no problem to buy a Wi-Fi adapter with limits of the USA that are 500mW, but maybe you can get lucky and buy something that can go up to 1W as an adapter targeting countries like Chille.
I have personally bought Alfa AWUS036NEH adapter that can go 1000mW (1W) and you can pretty much get this thing on Amazon.com. Below is a picture how it looks like.
Then the only other thing you need is a PC with linux installed that we will be creating the custom regulatory database to. I am personally using the BackTrack 5r3 distribution, but this is ubuntu based distro so you should be capable of following the guide on any debian/ubuntu-like distro.
Step by Step guide to change regulatory database
The following steps should be followed, I will try to explain each step to the best of my abilities.
Step 0. Check you current regulatory database limits for your country
First, it is a good idea to see if you are actually limited already. You can check this with command iw reg get as shown below.
In my particular instance, the country is not provided, so the system went back to “safe default” and inserted country 00. This non-existent country has the most restrictive transmission levels on all possible country spectrum. 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 cart can go up to 1W (30db) or 500mW (27db), I can only set values from 1 to 20 and if I try to enter higher value, I will get an error.
This is the limit that we would like to avoid so that we can configure txpower fo 27 or 30.
Step 1. Gathering all components for a new regulatory database
First have apt-get install you a few needed packages by using the apt-get command. Most of these will already be installed, but this is good to be sure to check.
Secondly, download source code for the regulatory database (debian version) here, or via backup link.
Thirdly, you will also need the crda regulatory package here, or via backup link.
Step 2. Editing the files before compilation
Unpack the wireless-regdb_2009.11.25.orig.tar.bz2 and enter the new directory wireless-regdb_2009.11.25. Inside, first open the db2bin.py file and change the first line from:
to
This will enable you to compile the database with the newer python2 package.
Now, lets 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 levels of power protection like this for the generic country 00.
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. In this example, I will be creating editing the default country 00 because my system thinks this is the country I am in. I have edited country 00 like this:
This basically overrides all the “PASSIVE-SCAN” and “NO-IBSS” limits and also upgraded the limits to 30db for each frequency.
Step 3. Compilation & Install
Ok, now we have our custom regulatory database created, we have to generate it in binary format for the linux kernel.
And then make install
Step 4. CRDA
Ok, Step 1 is to extract the package with command like tar -xvf ./crda-1.1.3.tar.bz2, then edit the python script for creating the directory for the newer python version. This is the same that we did before in Step 2.
BEFORE:
AFTER:
Now for the new CRDA package, we need the public keys we compiled previously. So copy the two public keys from the wireless-regdb to crda-1.1.3/pubkeys directory.
Поделиться:
By serg • Без категории 0