LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices


Reply
  Search this Thread
Old 02-04-2010, 04:33 AM   #1
peterx14
LQ Newbie
 
Registered: Aug 2003
Location: UK
Posts: 4

Rep: Reputation: 0
Question Where should I add iwconfig options to make them permanent?


Hi all,

I have recently setup a computer running Ubuntu 9.10 with an Edimax EW-7128G PCI card. It works fine, except when I try to connect to this computer remotely, there's lot of packet loss.

Anyway, to cut a long story short, I have found I can solve this by disabling power management using:
Code:
$ sudo iwconfig wlan0 power off
But where is the correct place to insert this so that power management is always disabled?

FYI - This machine is configured to automatically login, and I have gone through the network manager and set the wireless connection to be "Available to all users". Without doing this, at bootup, it would ask for the user password in order to enable the WiFi!

TIA,

Peter.
 
Old 02-04-2010, 04:55 AM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Bookworm (Fluxbox WM)
Posts: 1,391
Blog Entries: 54

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
Have a look at 'man interfaces', which covers setting up /etc/network/interfaces. For example, there are the pre-up and post-up options which allow commands to be run before/after the interface is brought up, which might be a place to place the power management settings.

Alternatively (and this might work better with network manager in control) is to modify the scripts in /etc/network/if-pre-up.d - you might already find one for wireless-tools. For example, some have the lines
Code:
if [ -n "$IF_WIRELESS_POWER" ]; then
  $IWCONFIG "$IFACE" power $IF_WIRELESS_POWER
which means it is just a matter of setting IF_WIRELESS_POWER to 'off' at the start of the script.

Last edited by neonsignal; 02-04-2010 at 05:04 AM.
 
Old 02-04-2010, 09:23 AM   #3
peterx14
LQ Newbie
 
Registered: Aug 2003
Location: UK
Posts: 4

Original Poster
Rep: Reputation: 0
Thanks loads for your reply!

Quote:
Originally Posted by neonsignal View Post
Alternatively (and this might work better with network manager in control) is to modify the scripts in /etc/network/if-pre-up.d - you might already find one for wireless-tools. For example, some have the lines
Code:
if [ -n "$IF_WIRELESS_POWER" ]; then
  $IWCONFIG "$IFACE" power $IF_WIRELESS_POWER
which means it is just a matter of setting IF_WIRELESS_POWER to 'off' at the start of the script.
That _should_ work, but it doesn't. As far as I can figure out, the folks working on the Gnome Network Manager decided that they didn't need to support the if-pre-up scripts! Nope, I've no idea why they thought that was a good idea... and I've also no idea why the directory still exists in Ubuntu 9.10 when it doesn't seem to get used.

Anyway, I've got it working now thanks to your pointers -- this is what I did:

Create a network "up" script:
Code:
$ sudo vim /etc/network/if-up/wifi_disable_power_management
And paste in the following:
Code:
#!/bin/sh
iwconfig "$IFACE" power off
Once the file has been saved, make it executable:
Code:
$ sudo chmod +x /etc/network/if-up/wifi_disable_power_management
I subsequently found this post which is like your suggestion, but they've then symlinked the wireless-tools file to the if-up.d directory to make it get executed!!

All working now though -- thanks again!
 
Old 05-21-2010, 09:48 AM   #4
Kerridis
LQ Newbie
 
Registered: Jun 2001
Location: Germany
Distribution: siduction, antiX, LXLE, Kubuntu
Posts: 25

Rep: Reputation: 15
What is the difference to writing "iwconfig wlan0 power off" into /etc/rc.local?
 
Old 05-24-2010, 04:02 PM   #5
darkcity
LQ Newbie
 
Registered: May 2010
Posts: 18

Rep: Reputation: 7
Does the wireless connection have to be up and running to issue 'iwconfig... ...power off' command?

I've been experimenting with puppy linux using 'iwconfig wlan0 rate 5.5M fixed' to get better connection. Someone suggested adding a 'sleep 30' line before to allow connection to be made and then configured.

Last edited by darkcity; 05-24-2010 at 04:03 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add the permanent route in linux fedora core 6 cmx08 Linux - Networking 7 09-01-2010 12:00 PM
Make route permanent rust8y Solaris / OpenSolaris 9 12-10-2007 04:10 AM
How to make txqueuelen changes permanent? bcg121 Linux - Networking 0 11-02-2007 07:32 AM
permanent module options: where to set? mehlkelm Debian 2 09-20-2005 02:18 AM
Debian: How do I set wireless (iwconfig) options at boot? muzicman82 Linux - Wireless Networking 1 06-06-2004 11:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking

All times are GMT -5. The time now is 09:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration