PDA

View Full Version : Increase Wi-Fi TX Power / Signal Strength



Hitman
2013-05-03, 20:36
The default TX-Power of wireless is set to 20 dBm but you can increase it with a little trick to 30 dBm but let me warn you first that It might be illegal in your country, so use it at your own risk. Moreover Some models will not support these settings or wireless chip may state that it "can" transmit with higher power, but the device's manufacturer probably did not place the appropriate heat sink in order to accomplish this.

There are also many ways to do it but i will share two simple methods.

1st Method.

iw reg set BO
iwconfig wlan0 txpower 30

If above method gives the following error then go for 2nd method.

Error for wireless request "Set Tx Power" (8B26) :
SET failed on device wlan0 ; Invalid argument.



2nd Method.


ifconfig wlan0 down
iw reg set BO
ifconfig wlan0 up
iwconfig wlan0 channel 13
iwconfig wlan0 txpower 30


For your reading visit the below links
http://en.wikipedia.org/wiki/Wi-Fi
http://git.kernel.org/cgit/linux/kernel/git/linville/wireless-regdb.git/tree/db.txt?id=HEAD

ltdanno
2013-05-03, 21:41
WOW awesome this totally worked ! i used option # 2

ifconfig wlan0 down
iw reg set BO
ifconfig wlan0 up
iwconfig wlan0 channel 13
iwconfig wlan0 txpower 30

and when it was done i ran a plain iwconfig and it says tx power 30 hope it dont melt my pci wireless card **** dont matter i got a few of them...

Malachai
2013-05-07, 00:19
But remember when you change the power of the device it will get hot so try not to run it all night long unless you need too.

Return0
2013-05-12, 20:56
sigh Tried to change the regulatory domains (for educational reasons) changed the db.txt to 48 under 00 (card can handle it all day trust me) crda 1.1.3 wouldnt make so I in a half asleep state did a make && make install with the wireless-regdb to try it out as crda is already on kali now my card is locked to 20 ever under BO and BZ. any advice from anyone?

Nubbix
2013-05-14, 22:01
ifconfig wlan0 down
iw reg BO
iw reg get <----- just to confirm BO is set

iw dev wlan0 set txpower fixed 30mBm // replace auto for automatical selecting the best option



if that does not work on your card, do

iw phy wlan0 set txpower fixed 30mBm


In best cases your card is supported and txpower is set, if you keep getting error, your network card is not supported for change and default auto is set

Needlephreak
2013-05-21, 03:01
#!/bin/bash

echo "hello, HaVoK!"
echo " taking down wlan0"
ifconfig wlan0 down
sleep 3

echo "setting Region to Bolivia"
iw reg set BO
sleep 3

echo "setting TxPower to 30"
iwconfig wlan0 txpower 30
sleep 2

echo "starting wlan0"
ifconfig wlan0 up
echo "pulling wlan0 interface up"
iwconfig
sleep 5


echo " "
echo " BY "
echo " +-+-+ +-+-+-+-+-+ +-+-+ "
echo " HaVoK "
echo " +-+-+ +-+-+-+-+-+ +-+-+ "
echo " "
echo " "

sleep 1

echo "good bye"

Hitman
2013-05-21, 14:21
Nice Neeldephreak well done & don't sleep too much :-)

r3d
2013-06-01, 00:06
Hey! thank you for sharing this with us. How can i change this permanently because everytime i restar my PC i have to do it again?

Hitman
2013-06-01, 19:16
@r3d put the above commands at the end of /etc/rc.local file and at the end dont forget to add one more command exit 0 ok. So whenever you will boot the kali it will set the settings automatically.

r3d
2013-06-08, 00:30
thx! nice post.

auastyle
2013-06-18, 15:48
auastyle@auastyle:~$ sudo iwconfig wlan0 txpower 30
Error for wireless request "Set Tx Power" (8B26) :
SET failed on device wlan0 ; Invalid argument.

What should i do...?

Hitman
2013-06-19, 02:18
Use the 2nd method that i mentioned in the post it will work

auastyle
2013-06-19, 13:33
Use the 2nd method that i mentioned in the post it will work

This is my result:

auastyle@auastyle:~$ sudo ifconfig wlan0 down
auastyle@auastyle:~$ sudo iw reg set BO
auastyle@auastyle:~$ sudo ifconfig wlan0 up
auastyle@auastyle:~$ sudo iwconfig wlan0 channel 13
auastyle@auastyle:~$ sudo iwconfig wlan0 txpower 30
Error for wireless request "Set Tx Power" (8B26) :
SET failed on device wlan0 ; Invalid argument.
auastyle@auastyle:~$

wifiuk
2013-06-19, 19:58
This is my result:

auastyle@auastyle:~$ sudo ifconfig wlan0 down
auastyle@auastyle:~$ sudo iw reg set BO
auastyle@auastyle:~$ sudo ifconfig wlan0 up
auastyle@auastyle:~$ sudo iwconfig wlan0 channel 13
auastyle@auastyle:~$ sudo iwconfig wlan0 txpower 30
Error for wireless request "Set Tx Power" (8B26) :
SET failed on device wlan0 ; Invalid argument.
auastyle@auastyle:~$

make sure mon0 is also down

so



iwconfig mon0 down


then try method two again that worked for me

nautic3727
2013-06-25, 19:36
I have an Alfa AWUS036NH (2000 milliwatt WiFi device) connected to a USB 2.0 port on a notebook PC. Although the USB 2.0 spec. calls for 500 milliamperes at 5 volts for each USB port, this notebook will only supply 150 milliamperes at 5 volts for each USB port, so I have ordered a powered USB hub which will supply 3000 milliamperes or 3 amperes to it's four USB ports. I expect to see a significant increase in performance. According to searches that I've done on the web, the AWUS036NH input power is 500 - 550 milliamperes at 5 volts which is believable, since this device can output 2000 milliwatt. At 100% efficiency, which isn't going to happen, the input should be 400 milliamperes at 5 volts, so 500 - 550 milliamperes sounds about right.

Needlephreak
2013-07-06, 06:29
Nice Neeldephreak well done & don't sleep too much :-)

thanks for the tip
i just wanted enough time for the end user to see the info thats the first script i've ever written =]

schwermie
2013-07-07, 06:06
Great post. I just wanted to add, increasing power is only effecient one way. A better antenna (even better a directional one) works better both ways. It is nice they hear you a few blocks away, but if you can't hear the other side, it is useless.

Just to be aware of this. @Needlephreak, nice script!

Needlephreak
2013-07-18, 00:48
Great post. I just wanted to add, increasing power is only effecient one way. A better antenna (even better a directional one) works better both ways. It is nice they hear you a few blocks away, but if you can't hear the other side, it is useless.

Just to be aware of this. @Needlephreak, nice script!

thanks, and thats a good tip it makes sense. i've never actually thought about that i thought as long as they heare you that you're in buisness.
i also found this could prove to be pretty useful. http://fabfi.fabfolk.com/

JackSparrow
2013-07-22, 21:00
Might be a silly question, But
Will this permantly change the dPM to 30 of you'r wifi card even if you use windows afterwards?
(I got dual boot)

Tirn
2013-07-24, 21:03
Might be a silly question, But
Will this permantly change the dPM to 30 of you'r wifi card even if you use windows afterwards?
(I got dual boot)

Hey Jack,
The answer is NO.
It has nothing to do with the dual-boot fact.
But, everytime you plug the card out and in, or everytime you reboot, etc. the card goes back to "default".
You may want to use a script for TXPower leveling, MAC changing, etc...
Best,

shaberu
2013-07-27, 12:50
im using a live usb and something i did managed to perminatly set the regionto BO even when i reboot it still said Tx-Power=30 dBm

JackSparrow
2013-07-28, 17:37
I have tried both option's but i still recieve the same error,

Is this maybe cause my wifi card can't support 20 + DPM?

I tried change it below 20 and it worked but if i try to set it 21 or higher i recieve the same error,

2undo
2013-08-16, 09:32
Where is regulatory.bin file located in kali? I fine only how-to for backtrack but kali seems to be different

DrDinosaur
2013-10-19, 03:05
I still get errors with option #2:


root@Kali:~# ifconfig wlan0 down
root@Kali:~# iw reg set BO
root@Kali:~# ifconfig wlan0 up
root@Kali:~# iwconfig channel 13
iwconfig: unknown command "13"
root@Kali:~# iwconfig wlan0 channel 13
Error for wireless request "Set Frequency" (8B04) :
SET failed on device wlan0 ; Invalid argument.
root@Kali:~# iwconfig wlan0 txpower 30
Error for wireless request "Set Tx Power" (8B26) :
SET failed on device wlan0 ; Invalid argument.
root@Kali:~#

Quest
2013-10-19, 14:04
root@kali:~# ifconfig wlan1 down
root@kali:~# iw reg set BO
root@kali:~# ifconfig wlan1 up
root@kali:~# iwconfig wlan1 channel 13
root@kali:~# iwconfig wlan1 txpower 30
Error for wireless request "Set Tx Power" (8B26) :
SET failed on device wlan1 ; Invalid argument.

sab3awi
2013-10-23, 11:54
I guess this doesn't increase the "Receiving" sensitivity of your device.

petu
2013-11-08, 16:06
It seems to me I've found the solution.

You should do 'ifconfig <device> down' for all the wireless devices!
After all the wireless devices were down, you can make 'iw reg set BO' successfully! And 'iwconfig <scan_device> txpower 30' ;).

Lancha
2013-11-12, 21:44
i new in kali and i want know if i can Increase Wi-Fi TX Power / Signal Strength of my wifi adaptar
my model is D link DWL G122 version 5.0

mmusket33
2013-12-08, 11:31
WE have run six AWUSO36H wifi recievers at 30 dBm constantly for over two years and have never had any problems. One country we ran it outside when free air temperatures were 48 degress C in the shade for months.

Phantani
2014-02-24, 17:28
Hello,
If I follow these instructions for my Alfa AWUS036H happily shows the Tx Power increased up to 30.

The problem is, that it looks like the card stops working afterwards. a
airodump-ng doesn't catch any packet on any channel until I switch the country code back to the original '00'.
Any clues?
Thank you very much!

RayZhupa
2015-02-10, 20:31
is this dangerous for the device,maybe a overheat or over consume (so the device will die sooner) ?

frafri
2015-02-26, 16:55
It did not work for me. None of the options.

Etron13
2015-09-08, 22:32
This is a great post and I am glad it is working for most people. For myself I am having some trouble. I have downloaded all of the appropriate files and followed the steps step for step on a clean image of Kali 1.1.0c running as a VM inside VMware Workstation. All of the libraries install without issues however when I get to the final make for the crda file, I get an error about the key-gcrypt.c file. The following error is provided. Any help would be extremely helpful.


root@kali:~/Downloads/crda# make
GEN keys-gcrypt.c
Trusted pubkeys: pubkeys/[email protected] pubkeys/linville.key.pub.pem pubkeys/root.key.pub.pem pubkeys/sforshee.key.pub.pem
: No such file or directory
make: *** [keys-gcrypt.c] Error 127

I have searched and searched for a solution but I can't find anything that points me in a direction to start digging further. According to Aptitude the libgcrypt library is installed.

Here is my Makefile:



# Modify as you see fit, note this is built into crda,
# so if you change it here you will have to change crda.c
REG_BIN?=/lib/crda/regulatory.bin
REG_GIT?=git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git

PREFIX ?= /usr/
MANDIR ?= $(PREFIX)/share/man/
INCLUDE_DIR ?= $(PREFIX)/include/reglib/
LIBDIR ?= $(PREFIX)/lib

SBINDIR ?= /sbin/

# Use a custom CRDA_UDEV_LEVEL when callling make install to
# change your desired level for the udev regulatory.rules
CRDA_UDEV_LEVEL?=85
UDEV_LEVEL=$(CRDA_UDEV_LEVEL)-
# You can customize this if your distributions uses
# a different location.
UDEV_RULE_DIR?=/lib/udev/rules.d/

# If your distribution requires a custom pubkeys dir
# you must update this variable to reflect where the
# keys are put when building. For example you can run
# with make PUBKEY_DIR=/usr/lib/crda/pubkeys
PUBKEY_DIR?=pubkeys
RUNTIME_PUBKEY_DIR?=/etc/wireless-regdb/pubkeys

CFLAGS += -O2 -fpic
CFLAGS += -std=gnu99 -Wall -Werror -pedantic
CFLAGS += -Wall -g
LDLIBREG += -lreg
LDLIBS += $(LDLIBREG)
LDLIBS += -lm
LIBREG += libreg.so
LDFLAGS += -L ./


all: all_noverify verify

all_noverify: $(LIBREG) crda intersect regdbdump db2rd optimize

ifeq ($(USE_OPENSSL),1)
CFLAGS += -DUSE_OPENSSL -DPUBKEY_DIR="$(RUNTIME_PUBKEY_DIR)" `pkg-config --cflags openssl`
LDLIBS += `pkg-config --libs openssl`

$(LIBREG): keys-ssl.c

else
CFLAGS += -DUSE_GCRYPT
LDLIBS += -lgcrypt

$(LIBREG): keys-gcrypt.c

endif
MKDIR ?= mkdir -p
INSTALL ?= install

NL1FOUND := $(shell pkg-config --atleast-version=1 libnl-1 && echo Y)
NL2FOUND := $(shell pkg-config --atleast-version=2 libnl-2.0 && echo Y)
NL3FOUND := $(shell pkg-config --atleast-version=3 libnl-3.0 && echo Y)
NL32FOUND := $(shell pkg-config --atleast-version=3 libnl-3.2 && echo Y)

ifeq ($(NL32FOUND),Y)
CFLAGS += -DCONFIG_LIBNL30
NLLIBS += $(shell pkg-config --libs libnl-genl-3.2)
NLLIBNAME = libnl-3.2
else
ifeq ($(NL3FOUND),Y)
CFLAGS += -DCONFIG_LIBNL30
NLLIBS += $(shell pkg-config --libs libnl-genl-3.0)
NLLIBNAME = libnl-3.0
else
ifeq ($(NL2FOUND),Y)
CFLAGS += -DCONFIG_LIBNL20
NLLIBS += -lnl-genl
NLLIBNAME = libnl-2.0
else
ifeq ($(NL1FOUND),Y)
NLLIBNAME = libnl-1
endif
endif
endif
endif

ifeq ($(NLLIBNAME),)
$(error Cannot find development files for any supported version of libnl)
endif

NLLIBS += `pkg-config --libs $(NLLIBNAME)`
CFLAGS += `pkg-config --cflags $(NLLIBNAME)`

ifeq ($(V),1)
Q=
NQ=@true
else
Q=@
NQ=@echo
endif

$(REG_BIN):
$(NQ) ' EXIST ' $(REG_BIN)
$(NQ)
$(NQ) ERROR: The file: $(REG_BIN) is missing. You need this in place in order
$(NQ) to verify CRDA. You can get it from:
$(NQ)
$(NQ) $(REG_GIT)
$(NQ)
$(NQ) "Once cloned (no need to build) cp regulatory.bin to $(REG_BIN)"
$(NQ) "Use "make noverify" to disable verification"
$(NQ)
$(Q) exit 1

keys-%.c: utils/key2pub.py $(wildcard $(PUBKEY_DIR)/*.pem)
$(NQ) ' GEN ' $@
$(NQ) ' Trusted pubkeys:' $(wildcard $(PUBKEY_DIR)/*.pem)
$(Q)./utils/key2pub.py --$* $(wildcard $(PUBKEY_DIR)/*.pem) $@

$(LIBREG): regdb.h reglib.h reglib.c
$(NQ) ' CC ' $@
$(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $^

install-libreg-headers:
$(NQ) ' INSTALL libreg-headers'
$(Q)mkdir -p $(DESTDIR)/$(INCLUDE_DIR)
$(Q)cp *.h $(DESTDIR)/$(INCLUDE_DIR)/

install-libreg:
$(NQ) ' INSTALL libreg'
$(Q)mkdir -p $(DESTDIR)/$(LIBDIR)
$(Q)cp $(LIBREG) $(DESTDIR)/$(LIBDIR)/
$(Q)ldconfig

%.o: %.c regdb.h $(LIBREG)
$(NQ) ' CC ' $@
$(Q)$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<

crda: crda.o
$(NQ) ' LD ' $@
$(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS) $(NLLIBS)

regdbdump: regdbdump.o
$(NQ) ' LD ' $@
$(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)

intersect: intersect.o
$(NQ) ' LD ' $@
$(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)

db2rd: db2rd.o
$(NQ) ' LD ' $@
$(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)

optimize: optimize.o
$(NQ) ' LD ' $@
$(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)

verify: $(REG_BIN) regdbdump
$(NQ) ' CHK $(REG_BIN)'
$(Q)\
LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) \
./regdbdump $(REG_BIN) >/dev/null

%.gz: %
@$(NQ) ' GZIP' $<
$(Q)gzip < $< > $@

install: install-libreg install-libreg-headers crda crda.8.gz regdbdump.8.gz
$(NQ) ' INSTALL crda'
$(Q)$(MKDIR) $(DESTDIR)/$(SBINDIR)
$(Q)$(INSTALL) -m 755 -t $(DESTDIR)/$(SBINDIR) crda
$(NQ) ' INSTALL regdbdump'
$(Q)$(INSTALL) -m 755 -t $(DESTDIR)/$(SBINDIR) regdbdump
$(NQ) ' INSTALL $(UDEV_LEVEL)regulatory.rules'
$(Q)$(MKDIR) $(DESTDIR)/$(UDEV_RULE_DIR)/
@# This removes the old rule you may have, we were not
@# putting it in the right place.
$(Q)rm -f $(DESTDIR)/etc/udev/rules.d/regulatory.rules
$(Q)sed 's:$$(SBINDIR):$(SBINDIR):' udev/regulatory.rules > udev/regulatory.rules.parsed
$(Q)ln -sf regulatory.rules.parsed udev/$(UDEV_LEVEL)regulatory.rules
$(Q)$(INSTALL) -m 644 -t \
$(DESTDIR)/$(UDEV_RULE_DIR)/ \
udev/$(UDEV_LEVEL)regulatory.rules
$(NQ) ' INSTALL crda.8.gz'
$(Q)$(MKDIR) $(DESTDIR)$(MANDIR)/man8/
$(Q)$(INSTALL) -m 644 -t $(DESTDIR)/$(MANDIR)/man8/ crda.8.gz
$(NQ) ' INSTALL regdbdump.8.gz'
$(Q)$(INSTALL) -m 644 -t $(DESTDIR)/$(MANDIR)/man8/ regdbdump.8.gz

clean:
$(Q)rm -f $(LIBREG) crda regdbdump intersect db2rd optimize \
*.o *~ *.pyc keys-*.c *.gz \
udev/$(UDEV_LEVEL)regulatory.rules udev/regulatory.rules.parsed

mthbb
2015-11-24, 14:21
Hi I am new on here but trying to change my alfa adapter up to 30db but getting no success, everything goes ok until I do the iwconfig wlan0 channel 13, I tried typing I think iwconfig wlan0 list channels and came up only had 11 channels so this I guess is why I have the error code when typing the channel 13 command?

I have the alfa AWUS036NHP adapter.

Grateful if anyone can help!

mmusket33
2015-11-27, 06:23
This works on a AWUS036H

ifconfig wlan0 down
iw reg set GY
ifconfig wlan0 up
ifconfig # check set to 30dBm

MTeams

crypts3c
2015-12-08, 23:11
This won't work without creating a new regulatory.bin file. Or at least it never worked for me. I always had to use CRDA.zip and wireless-regdb.zip and extract these and compile them with parameters changed (I simply changed the "world" domain at the top of the regdb.txt file to 33dBm).

Mine is working fine on Kali 2.0 (at 33dBm).

I have an Alfa AWUS0369NHA adapter.

Also, Etron13, I found I had to download the two packages that are not in the repositories (from when it used to work 6 to 9 months ago). You need to install python-m2crypto libgcrypt11 libgcrypt11-dev libnl-dev, however, libgcrypt-11-dev and libnl-dev are not in the new repositories (I think those are the ones...but 2 are not available...it will let you know).

I had to download them individually from the debian squeeze repository online and install them using dpkg -i. Then compiling everything worked fine. I then uninstalled those older packages.

mmusket33
2015-12-09, 01:39
To crypts3c

Are you saying that even though iwconfig shows the Tx-power=30dbm that in fact the power has not been increased unless other things are done?

Please clarify.

MTeams

grid
2015-12-09, 13:26
Using the Guyana (GY) regulatory domain, mentioned by mmusket33, worked for me. This was on an Alfa AWUS036H

baazju
2015-12-14, 00:11
Using mmusket33's suggestion I changed mine and did a quick comparison. iwconfig shows 30dBm, and a quick check of APs within range shows between 5-6 extra APs after changing the regulatory domain. So from what I can tell there is a bit of a difference.

crypts3c
2015-12-14, 05:19
No... MMusket, I'm just saying I had problems last year trying to change tx-power simply by using "iw set XX" (and related commands), so I ended up following the more complicated method of creating your own regulatory.bin file.

This more complicated method had the benefits of being able to set your own rules. You don't even have to worry about countries. I just changed the regulations so that "00" (or world) had a limit of 33dBm. So my tx-power is at 33dBm. I imagine I could set it to 40dBm if I wanted to set the regulatory.bin file to a 40dBm limit, but my NIC would probably start on fire... :)

brunoaduarte
2015-12-14, 13:04
I believe that the cards have a firmware limitation to max rf power... I have 3 wlan adapters, one goes up to 33 dBm,oher goes at maximum 30 dBm, and the third one only goes up to 20 dBm (same computer with same regulatory files).

fajarnxm
2015-12-17, 07:52
thx for sharing guys

mrmaverick
2015-12-26, 20:28
This works on a AWUS036H

ifconfig wlan0 down
iw reg set GY
ifconfig wlan0 up
ifconfig # check set to 30dBm

MTeams

worked for me on kali 2.0!!!

KrakenTech
2017-04-15, 04:29
?? - TX is transmit, not RX; receive.

noobiannethunter
2017-04-25, 09:21
Sorry to pull up an old threat but I am at a loss with this now. I have two cards, a AWUS036NEH and a TPLINK WN772N and have tried these both in VWWare fusion with Kali and Ubuntu 14.04. I am NOT trying to increase power, I am actually trying to decrease it.

The arguments are accepted to the card but when I check the settings are not accepted. If the power levels are hardcoded to the device can someone suggest a card that will support this. If not could it be an issue that the card is managed somehwhere by the host OS and VMWare cannot change this?

iwconfig wlan0 txpower 10
root@kali:~# iwconfig
wlan0 IEEE 802.11bgn ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=20 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off

MRXMISX
2017-05-14, 23:02
Confirmed working HP Pavilion DV7 Kali Linux Sana

8ot-79
2017-05-20, 13:19
This works on a AWUS036H

ifconfig wlan0 down
iw reg set GY
ifconfig wlan0 up
ifconfig # check set to 30dBm

MTeams

Thank you very much Mmusket, it works on Kali 2 and AWUS036NH ! Great !

murdershewr0te
2017-06-17, 03:16
Can someone explain the importance of upping the tx power?