Jump to content

txpower on laptop too low everytime it boots up


SystemCrash86

Recommended Posts

txpower on laptop keeps switching from 20dbm to 16dbm everytime i reboot or restart my wireless in linux and ubuntu.

My default txpower for my wireless interface is 16dbm but if i type "iwconfig wlan0 txpower 20" it goes upto 20dbm like it should.

Its very annoying to do this every time i boot up my laptop just to get a decent signal. Is there any way to make it so that 20dbm is the default instead of 16dbm?

Link to comment
Share on other sites

Most distros have a location where you can provide your own bootup scripts.

On Gentoo it's /etc/local.d where any executable file that has a .start extension is run at boot. I use this to set the harddisk spindown timeout on my file server back home (which is idle roughly 90% of the time, so it makes sense here).

Slackware used to have /etc/init.d/local for your editing pleasure and I see Gentoo adapted this, providing here a script that runs the things in /etc/local.d which means you should add the local script to a runlevel you're using.

Link to comment
Share on other sites

I managed to edit the /etc/rc.local file in linux so that when it boots i get 20dbm instead of my usual 16dbm. Which is great, except for one small problem - if lose connection to my internet and have to reconnect or if i have to reboot my network manager i go back to 16dbm.

Link to comment
Share on other sites

Depending on when it is being reset to 16dbm you may find that you need to put it in a script that runs when you bring up your wireless interface. e.g. for Debian based distros putting the following in an executable script in your '/etc/network/if-up.d/' directory, or if you find you need to run it just before your interface comes up then put it in your '/etc/network/if-pre-up.d' directory.

#!/bin/sh
# Set txpower to 20dbm for wlan0
# Note this is written from memory so will need debugging!!

# catch all wlan interfaces and set their txpower (if using bash you could
# switch this to an if using [[ and wildcards).
case "$IFACE" in
  "wlan"*) iwconfig $IFACE txpower 20 ;;
esac

exit 0
Link to comment
Share on other sites

I dual boot my laptop with ubuntu 14.04 and kali linux and since that worked on my ubuntu side i thought i would try it onmy kali side and it worked on there as well, except for one small issue - if i put the wlan0 interface into monitor mode and just to test it use the command "wash -i mon0" as an example both the mon0 interface and wlan0 interface go back to 16dbm and remains that way till i stop the monitor interface and restart network manager. Any ideas?

Link to comment
Share on other sites

The script was only looking for interfaces whose name starts with wlan, so a mon interface wouldn't be caught. Try this slight tweak to the script, that'll set the txpower for an interface to 20 if its name starts with either wlan or mon. (note the additional line in the case block)

#!/bin/sh
# Set txpower to 20dbm for wlan0
# Note this is written from memory so will need debugging!!

# catch all wlan and mon interfaces and set their txpower (if using bash you could
# switch this to an if using [[ and wildcards).
case "$IFACE" in
  "wlan"*) iwconfig $IFACE txpower 20
  ;;
  "mon"*) iwconfig $IFACE txpower 20
  ;;
esac

exit 0
Link to comment
Share on other sites

What happens if you try to set your txpower to 20 after starting wash? Does it allow you to increase the power or does it limit you back down to 16?

Link to comment
Share on other sites

What happens if you try to set your txpower to 20 after starting wash? Does it allow you to increase the power or does it limit you back down to 16?

Hi, i tried increaseing the power after starting wash or airodump-ng and it won't let me, it keeps staying at 16. When i stop the process i am able to once again adjust the power back up to a reasonable 20. But only keeps going back to 16 and stays there whenever i try and use it for something.

Link to comment
Share on other sites

Does it stay at 20 for wireless connections but drop down to 16 when monitoring, or does it also drop down to 16 when you're using it for normally? (I'm wondering if it is possible a setting in your crda settings, you may want to investigate that).

Link to comment
Share on other sites

Does it stay at 20 for wireless connections but drop down to 16 when monitoring, or does it also drop down to 16 when you're using it for normally? (I'm wondering if it is possible a setting in your crda settings, you may want to investigate that).

It usually stays at 20, thanks to that script but when i enable monitor mode they both drop down to 16 when monitoring and when i use it normally or it just stays at 20 until i actually use it.

I changed the "/etc/default/crda" to include GB (my country code) and "/lib/crda/setregdomain" to set my country code.

Is there anything else i missed?

Edited by SystemCrash86
Link to comment
Share on other sites

Update - as i dual boot between kali linux and ubuntu 14.04 i thought i would see if i had any problems on my ubuntu side.

First i checked the txpower and it was 20 which i from start up s that works, then using synaptic i install the aircrack-ng suite so i could get my card into monitor mode.

I put my card into monitor mode making a mon0 interface and i checked the txpower once again and it still said 20 - at the moment it is that same as my kali linux. I am not using the monitor interface yet and it is 20 dbm.

Then i used the interface using "airodump-ng mon0" and as that was running i tested the txpower and in another terminal and wow it remained at 20dbm - defferent from kali becasue at this point wlan0 and mon0 would have gone back to 16dbm.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...