-   Linux - Wireless Networking (
-   -   how to keep iwconfig encryption key (

odysseus.lost 08-18-2005 07:47 PM

how to keep iwconfig encryption key

how can I keep the key value on iwconfig? Everytime that the wireless device goes ifdown the key is lost. I believe that the same applies when it goes ifup. So, everytime I have to ifup the wireless device and after a second set the key value. A couple of posts mention some shell scripts to do the job. Is that the only and recommended way? And what about the key??? Isn't it kind of a security leak passing it unencrypted into a text file?


Matir 08-18-2005 08:35 PM

I do mine with a shell script. It's not like the WEP key is that secret. Most windows wifi utilities just store it unencrypted in the registry. :)

If someone has compromised your computer, that's probably a bigger issue than them just getting the WEP key :)

koobert637 08-18-2005 08:37 PM

Different distrobutions have different methods of storing network settings, so check your distrobutions documentation about networking. On debian, you have to edit /etc/network/interfaces and add something like wireless_key (Your key here)

About security the only way someone could really read it is if they had already rooted your box, in which case you are more screwed than you think ;)

odysseus.lost 08-19-2005 03:52 AM

Thanks for the help. I guess a shell script might do the job till I see where Fedora keeps the network devices settings. And trully indeed the only way for someone to get the key is to be root... provided your permissions are 700.

johnny5 09-04-2005 12:05 AM

does anyone have a real answer for this. i am currently in the same position. i have everything working correctly,
but on reboot all of the settings are gone.

installed w/ndiswrapper
setup iwconfig
ndiswrapper -m

so, wlan0 is seen on bootup, but no settings are saved. do i need to include entries in /etc/network....
if so, what. someone has got an easy answer for this other than setting up a script to run on boot.


Poetics 09-04-2005 05:25 AM

Unless you save the settings to a file the computer knows to look for on boot, they'll most likely be lost every reboot. Slackware has the rc.local file that is scanned for commands at every boot, but of course every Distro does things slightly differently. Look for a file where you can define such things in the startup scripts and you should be fine.

Matir 09-04-2005 11:28 AM

For those using KDE, one could give kwifimanager a try.

johnny5 09-04-2005 03:10 PM

the answer
ok. true to my word.. here it is. this is a full description of how to configure a wireless card that is not supported by default.
NOTE: i am using Kubuntu (although it works with its base, Ubuntu) and a truemoble 1350 (broadcom).


#apt-get install ndiswrapper-utils

this will install ndiswrapper. the other vital component is the winXP driver. go to and find the driver for truemoble
1350 (if your using a different card just find the driver) -- you won't be able to use the newest driver. you will need to unpack it..
i used a windows system because fudge figuring out on linux. save the .inf file (in my case bcmwl5a.inf or bcmwl5.inf) to some removable
device and transfer to linux system.

#ndiswrapper -i /path/to/.inf

make sure installed

#ndiswrapper -l

should say it is installed and there is a device that works with it. if it doesn't, find a different driver.

#modprobe ndiswrapper

for linux to "see" the card/driver/ndiswrapper

#ndiswrapper -m


#nano /etc/modules

this is to add ndiswrapper to modules .... so, your card will be loaded on boot. if you choose the second option, as i did, 'nano' will
start up and you will be able to add 'ndiswrapper' to one of the lines. each module to its own line!! example:

# /etc/modules: kernel modules to load at boot time.
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

ndiswrapper <---------WHAT I ADDED

you see i have added ndiswrapper. save this... directions are on the bottem of screen. now you must configure the network interfaces

#nano /etc/network/interfaces

you'll be presented with the following:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# This is a list of hotpluggable network interfaces.
# They will be activated automatically by the hotplug subsystem.
mapping hotplug
script grep
map eth0

# The primary network interface

_______________________________________________________________________this is what you need to pay attention to______ADDED

iface eth0 inet dhcp
auto eth0

iface wlan0 inet dhcp
wireless-essid MYESSID
wireless-key MYWEPKEY
auto wlan0

the area with the lines are added, so don't get confused. what i have added under both 'iface eth0 inet dhcp' and 'ifance wlan0 inet dhcp' the option 'auto xxx'. under the wlan0 section you must add 'wireless-essid YOURESSID' and 'wireless-key YOURWEPKEY'. now save. restart. done. another note: i
use nano, but you may use kate, vi, etc. you can go through the process of iwconfig, but i don't think it will be needed since your system will look to this to get the neccessary info. goood'a'luucka!

All times are GMT -5. The time now is 12:00 PM.