LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Wireless Networking (https://www.linuxquestions.org/questions/linux-wireless-networking-41/)
-   -   Using iwconfig (https://www.linuxquestions.org/questions/linux-wireless-networking-41/using-iwconfig-197513/)

cck23 06-25-2004 04:17 AM

Using iwconfig
 
Hi

I finally got my ndiswrapper installed and also the wireless tools 26 so that I could run iwconfig etc...

However, after a few hours I only managed to my wireless DLINK650+ to work a couple of times, i have been using iwconfig as per the doc to set:
  • essid
  • key encryption XXXXXX..
  • mode Managed

My card only works some of the time. But my main questions are....since I am completely new to iwconfig is how does it work?

where does it store the information/config?
Does the order of the various iwconfig commands matter?
If use pull the card out, are iwconfig commands lost?
What state does the card need to be (from ifconfig) for commands to work?

really sorry if i am asking too many questions but i'm pulling my hair out here trying to get the card to work...

CK

jopnickcon 06-25-2004 02:05 PM

iwconfig
 
Hello

I am very new to linux
Unfortunately I have to ask more questions instead of answering yours. I'm having the same problems. I am using an ndiswrapper... i can modprobe it and it comes up fine... then i run iwconfig wlan0 it shows the default settings for wireless connections.. Follow the same steps as cck23, and the card sees the wireless AP... and fills in the rest of the info... i bring the card up with ifconfig wlan0 up and it now shows when i do an ifconfig... but i lack an IP address. I can get one by running dhcpcd (which didnt come with Fedora Core2, i downloaded and installed it) and bam.. i'm online. but when i have to do this every time i start the computer.

I've tried setting the connection in the system --> Networking --> and there i can add a new wireless card... and it shows wlan(0)(ndiswrapper) so i add that... and enter in all the settings there... but then if I try to activate the card i get this error:

/sbin/ifup: line 60: 2440 Segmentation fault
iwconfig $DEVICE key $KEY

THEN¡K my computer hangs¡K at first I can still close stuff, but nothing else opens.. then it becomes altogether frozen.. and I have to hit the resart button¡K and I am filled with guilt as linux scolds me for not umounting the drives properly. Pretty sure I don¡¦t know what else to do.

I¡¦ve gone under /etc/sysconfig/network-scripts/ifcfg-wlan0
The key wasn¡¦t in there.. .but the ESSID and CHANNEL.. and other such things were there.. added KEY=(then my hex key here) with VI¡Kand no luck.. same errors¡K any suggestions?

And I have a question for you cck23, I¡¦d been working with mandrake 10 for a while, and that¡¦s the OS you have listed, I found that whenever I modprobe ndiswrapper, themachine would hang, do you get that problem? I was using ndiswrapper v0.8. but it always froze. Just wondering.

Anyhow, looking to my linux gurus for some help :) THX
Jopnick

cck23 06-25-2004 05:41 PM

Hi there Jop,

I dont get the machine hanging when I modprobe, though earlier today I had problem with some KDE applications starting really slowly. I tried removing the wireless card and using linux without it and it was fine. However, I dont know if that just pure coincence as I have not repeated that excercise more than two times to see if it was the wireless card causing the slowness.

though about 1/2 time I am able to get the wireless card to work. At the moment, it seems pot luck whether or not the card works.

Hopefully I will have worked out what the problems are in a coupld of days and will repost.

Have fun

CK

Hangdog42 06-26-2004 09:04 AM

Quote:

where does it store the information/config?
iwconfig only sets up the card, it doesn't store the information anywhere.

Quote:

Does the order of the various iwconfig commands matter?
You usually need to set your SSID first. Some commands (like setting your WEP key) may not work if the card hasn't found an access point. Other than that it probably doesn't matter

Quote:

If use pull the card out, are iwconfig commands lost?
What state does the card need to be (from ifconfig) for commands to work?
These two questions are related....If the card loses power (turned off) then yes, the information that iwconfig provided are lost. Similarly you need to have the card powered up and recognized by the system in order for iwconfig to set up the card.

Most, if not all, of these problems can be solved by adding the relevant commands to your /etc/rc.d/rc.local file. First modprobe ndiswrapper then add the needed iwconfig command. Finally you can issue a dhcpcd wlan0 (or dhclient wlan0, whichever works) and you should be up and running. By putting all of this in your rc.local it will get run every time you boot.

Quote:

/sbin/ifup: line 60: 2440 Segmentation fault
Obviously not good. Try setting the commands up in /etc/rc.d/rc.local.

Quote:

found that whenever I modprobe ndiswrapper, themachine would hang
Mandrake 10 has ndiswrapper 0.4 already installed so if you didn't remove it before adding a later ndiswrapper version, that may be causing the problem. I'm not entirely sure if this is the root of your problem but I do know there were very significant changes to ndiswrapper after 0.4 and the install instructions are very clear about removing 0.4 before installing a newer version.

cck23 06-26-2004 09:37 AM

Hi Hangdog,

i have the following problem when trying to use iwconfig commands:

Error for wireless request "Set Encode"
SET failed on device wlan0, operation not permitted.

I have searched via google and found a few other people that have this problem but no one seems to have an answer.

As a result of this, when I use iwlist to view the current settings, my key is not accepted so I cannot log on to the network.

CK

Hangdog42 06-26-2004 11:22 AM

Quote:

SET failed on device wlan0, operation not permitted.
This may be a kind of dumb suggestion, but are you running iwconfig as root or su?

cck23 06-26-2004 04:52 PM

I "su -" to root, and then run all my iwconfig commands as root user.

I did read somewhere that whatever user you run iw* commands as, you need permissions to certain files in /proc. However, when I look there there are loads of files there :(

CK

Hangdog42 06-27-2004 08:37 AM

Well, the stuff you would be interested in would be in /proc/net. Everything there sould be owned by root and read only, except for the directories which should be readable and executable. There should be a file in here called wireless that has info about the card. There should also be a ndiswrapper directory and if you drop into it you should see a directory with your card (wlan0). That direcotry has files containing the various card settings. All those files are read only, but not by users, They are also owned by root.

Here is mine if you want to compare
Code:

total 0
-r--r-----    1 root    root            0 Jun 27 09:36 hw
-r--r-----    1 root    root            0 Jun 27 09:36 stats
-r--r-----    1 root    root            0 Jun 27 09:36 wep


cck23 06-27-2004 10:45 AM

I'm beginining to think there is a bug. Someone else posted this on sourceforge as a bug.

All other iwconfig commands work, it just wont accept the following:

iwconfig wlan0 key open 1234567890.

CK

jopnickcon 06-27-2004 01:25 PM

Hey all

I formated and installed mandrake 10, just to see if i could get'er up in there, i tried uninstallng the ndiswrapper that was pressent but... I guess i dont know where it is to uninstall it...
i tried : "urpme ndiswrapper" but i guess that only gets it if the program was installed via the RPM manager.
all i know was that i wasnt able to start the ndiswrapper, or show anysigns of it being installed, but i know it was in there somewhere... anyhow... I got it to the point where it wouldnt hang but no luck getting wlan0 to show up.. even after i installed the driver in the ndiswrapper and modprobed it. mep.. waht can you do... so i, a quiter, went crawling back to Fedora :(


cck23, when i was doing my iwconfig settings, for the key, i just used iwconfig wlan0 key xxxxxxxxxxxxxxxxxxxxx and that worked fine, it didnt need the open in there to figure out the network key type, i think specifying the essid and channel (which are the only 2 settings i do before iwconfiging in the WEP key) it finds the network alright and figures out most the settings just needs they key. then i just start the card with

"ifconfig wlan0 up"

and then get an ip with

"dhcpcd wlan0" (for some reason after putting in teh key and activating the card... i dont grab an IP automaticly.. so i have to go and get one manually. but it works.. and i'm using linux on this card right now)

Still having my first issue though about getting the card to work with ifup... other wise that error. you'd suggested

quote:/sbin/ifup: line 60: 2440 Segmentation fault


Obviously not good. Try setting the commands up in /etc/rc.d/rc.local.

any suggestions as to what i should do in there... (i'm very new :) ) like a lines i should add. is that like a startup file? could i just enter then commands i normally issue to bring the cardup :

modprobe ndiswrapper
iwconfig wlan0 esside XXXX
iwconfig wlan0 channel 7
iwconfig wlan0 key XXXXXXXXXXXX
ifconfig wlan0 up
dhcpcd wlan0

that gets me online.. but i would LOVE to have a script to it automaticly on startup

Hangdog42 06-27-2004 05:25 PM

Quote:

but i would LOVE to have a script to it automaticly on startup
Dude, you are 99.99% of the way there. Just enter those commands you listed into your /etc/rc.d/rc.local file and your 100% of the way there. Or if you want to experiment a bit, create your own script and call it from rc.local or rc.inet1 (which usually sets up the network).

cck23 06-28-2004 04:22 AM

Hmm, I have now discovered that the problem is to do with setting the wep key. I used to be able to set it, but now i just get the error:

Error for wireless request "Set Encode" (8B2A) :
SET failed on device wlan0 ; Operation not permitted.

As a result, I cannot join wep enabled networks but I can join sucessfully wireless networks without wep. Any ideas please?

There is only one other fly in the ointment and that's when I run the ndiswrapper -l command which gives me:

Can't use string ("") as an ARRAY ref while "strict refs" in use at /usr/sbin/ndiswrapper line 324, <LS2> line 1.

Though I dont know if this is a red herring.

I would love any help with being able to set the wep key.

CK

Hangdog42 06-28-2004 07:42 AM

OK, something must have changed on your system. Have you been playing around with the system at all? I suppose the other approach would be to recompile and re-install ndiswrapper. If you weren't getting those errors before it could be that something has become corrupted.

By the way, you are root when running iwconfig, aren't you?

cck23 06-28-2004 08:49 AM

Yes - I thought something may have changed , though I do not know what. It was working one night and the following morning it refused to accept my wep key commands. If something changed, I can't think what.

At first i thought there were perhaps some 'stale' /proc stopping me from writting config info to the card...no luck there.

I have now given up trying to get the card to work now. I have logged a support request with sourceforge, lets see what that brings up, fingers crossed.

CK

ibrewale 06-29-2004 04:02 PM

I've had luck with just the following, as far as setting up for WEP

iwconfig eth0 key 123456789

of course, using your own encryption key. I would suppose that wlan0 would work for you also...?


Just my 2cents.

Jerry


All times are GMT -5. The time now is 08:10 AM.