LinuxQuestions.org
Review your favorite Linux distribution.
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 06-25-2004, 04:17 AM   #1
cck23
Member
 
Registered: Jun 2004
Location: Surrey, UK
Distribution: Mandrake 10 Download
Posts: 73

Rep: Reputation: 16
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
 
Old 06-25-2004, 02:05 PM   #2
jopnickcon
LQ Newbie
 
Registered: Jun 2004
Posts: 13

Rep: Reputation: 0
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
 
Old 06-25-2004, 05:41 PM   #3
cck23
Member
 
Registered: Jun 2004
Location: Surrey, UK
Distribution: Mandrake 10 Download
Posts: 73

Original Poster
Rep: Reputation: 16
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
 
Old 06-26-2004, 09:04 AM   #4
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,790
Blog Entries: 1

Rep: Reputation: 414Reputation: 414Reputation: 414Reputation: 414Reputation: 414
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.
 
Old 06-26-2004, 09:37 AM   #5
cck23
Member
 
Registered: Jun 2004
Location: Surrey, UK
Distribution: Mandrake 10 Download
Posts: 73

Original Poster
Rep: Reputation: 16
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
 
Old 06-26-2004, 11:22 AM   #6
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,790
Blog Entries: 1

Rep: Reputation: 414Reputation: 414Reputation: 414Reputation: 414Reputation: 414
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?
 
Old 06-26-2004, 04:52 PM   #7
cck23
Member
 
Registered: Jun 2004
Location: Surrey, UK
Distribution: Mandrake 10 Download
Posts: 73

Original Poster
Rep: Reputation: 16
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
 
Old 06-27-2004, 08:37 AM   #8
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,790
Blog Entries: 1

Rep: Reputation: 414Reputation: 414Reputation: 414Reputation: 414Reputation: 414
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
 
Old 06-27-2004, 10:45 AM   #9
cck23
Member
 
Registered: Jun 2004
Location: Surrey, UK
Distribution: Mandrake 10 Download
Posts: 73

Original Poster
Rep: Reputation: 16
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
 
Old 06-27-2004, 01:25 PM   #10
jopnickcon
LQ Newbie
 
Registered: Jun 2004
Posts: 13

Rep: Reputation: 0
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

Last edited by jopnickcon; 06-27-2004 at 01:26 PM.
 
Old 06-27-2004, 05:25 PM   #11
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,790
Blog Entries: 1

Rep: Reputation: 414Reputation: 414Reputation: 414Reputation: 414Reputation: 414
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).
 
Old 06-28-2004, 04:22 AM   #12
cck23
Member
 
Registered: Jun 2004
Location: Surrey, UK
Distribution: Mandrake 10 Download
Posts: 73

Original Poster
Rep: Reputation: 16
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
 
Old 06-28-2004, 07:42 AM   #13
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,790
Blog Entries: 1

Rep: Reputation: 414Reputation: 414Reputation: 414Reputation: 414Reputation: 414
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?
 
Old 06-28-2004, 08:49 AM   #14
cck23
Member
 
Registered: Jun 2004
Location: Surrey, UK
Distribution: Mandrake 10 Download
Posts: 73

Original Poster
Rep: Reputation: 16
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
 
Old 06-29-2004, 04:02 PM   #15
ibrewale
LQ Newbie
 
Registered: Jun 2004
Distribution: debian
Posts: 25

Rep: Reputation: 15
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
where does iwconfig get these? linuxhippy Slackware 2 04-18-2005 12:16 AM
iwconfig xcoaster1 Linux - Wireless Networking 15 04-03-2005 06:02 PM
iwconfig jp_ Linux - Wireless Networking 1 03-23-2005 11:59 PM
iwconfig help cucolin@ Linux - Wireless Networking 3 03-07-2005 11:59 AM
iwconfig help houston1981 Linux - Wireless Networking 3 12-09-2004 06:59 PM


All times are GMT -5. The time now is 04:07 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration