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 04-25-2009, 10:16 AM   #1
shva
Member
 
Registered: Feb 2009
Distribution: Fedora, Arch, Debian, Ubuntu
Posts: 56

Rep: Reputation: 15
have a question about WEP 40/128-bit key (try to connect under command line)


I tried to connect to the encrypted wireless under command line. What I did is:

# ifconfig wlan0 up
# iwlist wlan0 scan ( and I see my target wireless network is there)
# iwconfig wlan0 essid "My_Network" key 0123456789
# dhclient wlan0

But it did not work. What I was sure was I managed to connect to this network with this key in Ubuntu Network Manager, if using GUI. I later searched for this problem and it seemed that iwconfig recognized the key as hex by default. If using ascii, it should be:

# iwconfig wlan0 essid "My_Network" key s:0123456789

which used an ascii key. But even that I failed too. So I am just wondering how to get a hex key out of it? Is there any algorithm for this...?

Thank you very much.

Last edited by shva; 04-25-2009 at 10:17 AM.
 
Old 04-25-2009, 11:31 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
You say "it didn't work", but you don't say exactly what happened. For example, with my router, it is sometimes necesary to re-boot the router to get the wireless to work. iwconfig does not give any useful feedback in certain situations.

If the ascii key is "fred", then the hex is simply the codes for each letter--66 72 65 64. I don't remember if they are separated by ":" or something else.
 
Old 04-25-2009, 11:34 AM   #3
shva
Member
 
Registered: Feb 2009
Distribution: Fedora, Arch, Debian, Ubuntu
Posts: 56

Original Poster
Rep: Reputation: 15
when I type:

# iwconfig wlan0 essid "My_Network" key s:0123456789

I get Error for wireless request "Set Encode" (8B2A)

I don't know what it means
 
Old 04-25-2009, 11:52 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Hmmm

On my router, there are 3 choices for WEP key:

64-bit: 5 characters
128-bit: 13 characters
256-bit: 29 characters

In each mode, I have to use exactly the stated # of characters. Thus, there is no mode that would allow me to have a wep key with 10 characters.

Check your router settings to see what the options are, and post the settings of the router.
 
Old 04-25-2009, 11:59 AM   #5
shva
Member
 
Registered: Feb 2009
Distribution: Fedora, Arch, Debian, Ubuntu
Posts: 56

Original Poster
Rep: Reputation: 15
But this is the key I use to connect to the wireless successfully with Ubuntu Network Manager and wicd... This is the info from iwlist wlan0 scan:

Cell 08 - Address: 00:1E:58:37:83:A9
ESSID:"My_Network"
Mode:Master
Channel:6
Frequency:2.437 GHz (Channel 6)
Quality=58/100 Signal level:-73 dBm Noise level=-76 dBm
Encryption key: on
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
12 Mb/s; 24 Mb/s; 36 Mb/s; 9 Mb/s; 18 Mb/s
48 Mb/s; 54 Mb/s
Extra:tsf=00000157d60d6748
Extra: Last beacon: 24ms ago

Last edited by shva; 04-25-2009 at 12:01 PM.
 
Old 04-25-2009, 12:28 PM   #6
richwmn
LQ Newbie
 
Registered: Dec 2005
Location: Athens, GA
Distribution: Slackware (various),Ubuntu 9.04
Posts: 27

Rep: Reputation: 17
Quote:
Originally Posted by pixellany View Post
Hmmm

On my router, there are 3 choices for WEP key:

64-bit: 5 characters
128-bit: 13 characters
256-bit: 29 characters

In each mode, I have to use exactly the stated # of characters. Thus, there is no mode that would allow me to have a wep key with 10 characters.

Check your router settings to see what the options are, and post the settings of the router.
What kind of router do you have?
Some routers have the ability to enter the wep key in hex or ascii.
ASCII 5 character key is 10 hex characters
ASCII 13 character key is 26 hex characters
etc

Rich
 
Old 04-25-2009, 12:31 PM   #7
shva
Member
 
Registered: Feb 2009
Distribution: Fedora, Arch, Debian, Ubuntu
Posts: 56

Original Poster
Rep: Reputation: 15
I use D-link.
 
Old 04-25-2009, 12:36 PM   #8
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Please humor me and look at the router settings----and maybe try the key lengths that I mentioned. It is possible that the Ubuntu wireless manage does something like truncate a code that is too long.
 
  


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
Unable to connect to wap at work or home - 128 bit - Linux: 128 hex only option? pearsdb Linux - Newbie 5 05-28-2009 05:27 PM
cannot connect on wifi with WEP key 128bit PETROSHP Linux - Wireless Networking 1 11-07-2007 02:31 PM
when trying to connect to a wep protected AP, I am constantly asked for the key! guldan27 Linux - Wireless Networking 1 01-21-2007 08:39 AM
How to enable 40 bit WEP instead of 128 bit WEP tweedledee Linux - Wireless Networking 1 01-01-2004 10:33 AM
WEP 128 key - how to setup? pr1sg Linux - Wireless Networking 2 07-17-2003 07:39 PM

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

All times are GMT -5. The time now is 04:51 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