SystemCrash86 Posted March 6, 2015 Share Posted March 6, 2015 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? Quote Link to comment Share on other sites More sharing options...
cooper Posted March 6, 2015 Share Posted March 6, 2015 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. Quote Link to comment Share on other sites More sharing options...
SystemCrash86 Posted March 6, 2015 Author Share Posted March 6, 2015 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. Quote Link to comment Share on other sites More sharing options...
Jason Cooper Posted March 6, 2015 Share Posted March 6, 2015 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 Quote Link to comment Share on other sites More sharing options...
SystemCrash86 Posted March 6, 2015 Author Share Posted March 6, 2015 That worked. Thank you so much, i was looking for a solution for ages. When i boot up or restart my network manager it stays at 20dbm which is better then the 16dbm it used to be. Thank you. Quote Link to comment Share on other sites More sharing options...
SystemCrash86 Posted March 6, 2015 Author Share Posted March 6, 2015 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? Quote Link to comment Share on other sites More sharing options...
Jason Cooper Posted March 6, 2015 Share Posted March 6, 2015 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 Quote Link to comment Share on other sites More sharing options...
SystemCrash86 Posted March 6, 2015 Author Share Posted March 6, 2015 Thanks, i tried that and my monitor interface stays at 20 until i actually use it for example by typing "wash -i mon0" and then both wlan0 and my mon0 interface go back to being 16 Quote Link to comment Share on other sites More sharing options...
Jason Cooper Posted March 8, 2015 Share Posted March 8, 2015 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? Quote Link to comment Share on other sites More sharing options...
SystemCrash86 Posted March 10, 2015 Author Share Posted March 10, 2015 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. Quote Link to comment Share on other sites More sharing options...
Jason Cooper Posted March 10, 2015 Share Posted March 10, 2015 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). Quote Link to comment Share on other sites More sharing options...
SystemCrash86 Posted March 10, 2015 Author Share Posted March 10, 2015 (edited) 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 March 11, 2015 by SystemCrash86 Quote Link to comment Share on other sites More sharing options...
SystemCrash86 Posted March 11, 2015 Author Share Posted March 11, 2015 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. Quote Link to comment Share on other sites More sharing options...
cooper Posted March 11, 2015 Share Posted March 11, 2015 Then it's quite likely to be a kernel driver issue. Quote Link to comment Share on other sites More sharing options...
SystemCrash86 Posted March 11, 2015 Author Share Posted March 11, 2015 Then it's quite likely to be a kernel driver issue. How would i go about fixing that? I searched google but so far no luck Quote Link to comment Share on other sites More sharing options...
cooper Posted March 12, 2015 Share Posted March 12, 2015 I'd say drop the default Kali kernel and instead install mainline. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.