public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Why iwconfig wlan0 enc can't work?
@ 2011-10-21 14:03 Lavender
  2011-10-21 14:08 ` Michael Mol
  2011-10-21 19:36 ` Mick
  0 siblings, 2 replies; 3+ messages in thread
From: Lavender @ 2011-10-21 14:03 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 767 bytes --]

The essid of my dormitory wireless netword is "Rebellion"
 and its password is "I'll leave it up to you"(It's OK to tell
 you this private information :-) ) .
 I typed command below
 #iwconfig wlan0 up
 #iwconfig wlan0 essid "Rebellion"
 Commands above worked normally, then
  
 #iwconfig wlan0 mode master
  
 Our AP mode which iwlist shows is master,
 but the command above failed. Error message was
 "Invalid argument".
 Then I typed
 #iwconfig wlan0 mode managed 
 This worked , then
 #iwconfig wlan0 enc "I'll leave it up to you"
 This failed with error message "Invalid argument"
  
 I have searched the internet , but I didn't find 
 useful information .  The password is right , it 
 can work on windows system .So what's wrong
 with it?

[-- Attachment #2: Type: text/html, Size: 1228 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-user] Why iwconfig wlan0 enc can't work?
  2011-10-21 14:03 [gentoo-user] Why iwconfig wlan0 enc can't work? Lavender
@ 2011-10-21 14:08 ` Michael Mol
  2011-10-21 19:36 ` Mick
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Mol @ 2011-10-21 14:08 UTC (permalink / raw
  To: gentoo-user

On Fri, Oct 21, 2011 at 10:03 AM, Lavender <448463782@qq.com> wrote:
> The essid of my dormitory wireless netword is "Rebellion"
> and its password is "I'll leave it up to you"(It's OK to tell
> you this private information :-) ) .
> I typed command below
> #iwconfig wlan0 up
> #iwconfig wlan0 essid "Rebellion"
> Commands above worked normally, then
>
> #iwconfig wlan0 mode master
>
> Our AP mode which iwlist shows is master,
> but the command above failed. Error message was
> "Invalid argument".
> Then I typed
> #iwconfig wlan0 mode managed
> This worked , then
> #iwconfig wlan0 enc "I'll leave it up to you"
> This failed with error message "Invalid argument"
>
> I have searched the internet , but I didn't find
> useful information .  The password is right , it
> can work on windows system .So what's wrong
> with it?

What encryption method is used by the AP? The method you described
only kinda works for WEP. If the AP is using WPA or WPA2, you need a
WPA supplicant.

-- 
:wq



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-user] Why iwconfig wlan0 enc can't work?
  2011-10-21 14:03 [gentoo-user] Why iwconfig wlan0 enc can't work? Lavender
  2011-10-21 14:08 ` Michael Mol
@ 2011-10-21 19:36 ` Mick
  1 sibling, 0 replies; 3+ messages in thread
From: Mick @ 2011-10-21 19:36 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: Text/Plain, Size: 2371 bytes --]

On Friday 21 Oct 2011 15:03:31 Lavender wrote:
> The essid of my dormitory wireless netword is "Rebellion"
>  and its password is "I'll leave it up to you"(It's OK to tell
>  you this private information :-) ) .
>  I typed command below
>  #iwconfig wlan0 up
>  #iwconfig wlan0 essid "Rebellion"
>  Commands above worked normally, then
> 
>  #iwconfig wlan0 mode master
> 
>  Our AP mode which iwlist shows is master,
>  but the command above failed. Error message was
>  "Invalid argument".

Yes, your AP is operating in 'master' mode, while your PC's wireless NIC 
operates in 'managed' mode since it is a wireless client.


>  Then I typed
>  #iwconfig wlan0 mode managed
>  This worked , 

Good.  :-)

>  then
>  #iwconfig wlan0 enc "I'll leave it up to you"
>  This failed with error message "Invalid argument"

The "I'll leave it up to you" is not an encryption *key*, but a passphrase.

Have you looked at all at the man page for iwconfig?  Read what it says under 
key/enc[ryption]:

"... Passphrase is currently not supported."

This means that you need to use the corresponding hexadecimal or ASCII 
encryption key.  The router should show what this is when you login in its 
administrative GUI.

Alternatively, you can try running a script like this to generate a md5 hash - 
no guarantees that it will work with your AP (different vendors have different 
implementations:
========================
#!/usr/bin/perl
# Perl script to convert a passphrase to a WEP key.
# By Aki Mimoto

use strict;
@ARGV or die "Usage: $0 passphrase\n";
print generate_key( @ARGV ), "\n";

sub generate_key {
# --------------------------------------------------
        require Digest::MD5;
        return substr Digest::MD5::md5_hex( substr( shift() x 64, 0, 64 ) ), 
0, 26;
}
========================

Make it executable (using chmod u+x name of file) and then run it with your 
passphrase.  Note, I just found this on Google and have not tried it myself.  
I would always use a hex or ASCII key instead.

Ideally though, I would not be using WEP encryption which all of the above 
applies to, because it is not secure.

PS.  You haven't told us if the AP is using WEP, but you have used a WEP 
command to enter your encryption key - so I'm giving you here a WEP related 
answer.  ;-)

-- 
Regards,
Mick

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-10-21 19:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-21 14:03 [gentoo-user] Why iwconfig wlan0 enc can't work? Lavender
2011-10-21 14:08 ` Michael Mol
2011-10-21 19:36 ` Mick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox