LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-23-2009, 07:11 AM   #1
SolymyrBhaal
LQ Newbie
 
Registered: Nov 2009
Posts: 1

Rep: Reputation: 0
Cannot get iwconfig to connect from command line


Hey All,

I have seen that there is actually quite a few posts already out there on this topic, I.E connecting to a wireless network from the command line. However, I am battling to get this right. Please see the steps I am following to get this working. FYI I have done theses steps and get the same output on two different machines (one without a GUI using linux 2.6.29 (it is on a Freescale board), which is why I need to do this with the command line) - the only thing that is the same is the wireless card, the access point, and the steps I follow.

My card: Intel Corporation PRO/Wireless 4965 AG and using Ubuntu 9.04.

So just to get started I am able to connect to the wireless network when I use the GUI, goto the network Icon top right corner click rlc and it connects. This works for WEP and no security.

My Steps:

paladin@paladin-ubuntu:~$ sudo iwlist wlan0 scan
wlan0 Scan completed :
Cell 01 - Address: 00:19:70:05:07:54
ESSID:"rlc"
Mode:Master
Channel:11
Frequency:2.462 GHz (Channel 11)
Quality=88/100 Signal level:-44 dBm Noise level=-127 dBm
Encryption key: off
IE: Unknown: 0003726C63
IE: Unknown: 010482848B96
IE: Unknown: 03010B
IE: Unknown: 2A0104
IE: Unknown: 32080C1218243048606C
IE: Unknown: DD180050F2020101800003A4000027A4000042435E0062322F 00
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
48 Mb/s; 54 Mb/s
Extra:tsf=000000007bcce4c0
Extra: Last beacon: 808ms ago

In this example I use no security, you can see that encryption is off.

paladin@paladin-ubuntu:~$ sudo ifconfig wlan0 down
paladin@paladin-ubuntu:~$ sudo iwconfig wlan0 mode managed essid 'rlc' channel 11 ap 00:19:70:05:07:54
paladin@paladin-ubuntu:~$ sudo ifconfig wlan0 up
paladin@paladin-ubuntu:~$ sudo iwconfig wlan0
wlan0 IEEE 802.11abgn ESSID:"rlc"
Mode:Managed Frequency:2.462 GHz Access Point: Not-Associated
Tx-Power=15 dBm
Retry min limit:7 RTS thrff Fragment thr=2352 B
Encryption key: off
Power Management: off
Link Quality:0 Signal level:0 Noise level:0
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

As you can see I specify the Access Point in my command but it does not actually come through - I know it works cause if I change the essid it does detect this ("rlc1" instead of "rlc"). Also in the scan you can see that the Mode is detected as master, if I try and set this i get the following error:

paladin@paladin-ubuntu:~$ sudo ifconfig wlan0 downpaladin@paladin-ubuntu:~$ sudo iwconfig wlan0 mode Master essid 'rlc' channel 11 ap 00:19:70:05:07:54
Error for wireless request "Set Mode" (8B06) :
SET failed on device wlan0 ; Invalid argument.

You can also see that the Link Quality Signal Level and Noise Level are also always 0. Which would tell me that is is not connected to anything.

The next frustrating part is that if I try and set it up to be a secure connection that command also does not go through:

paladin@paladin-ubuntu:~$ sudo ifconfig wlan0 down
paladin@paladin-ubuntu:~$ sudo iwconfig wlan0 key 1234567890 mode managed essid 'rlc' channel 11 ap 00:19:70:05:07:54
paladin@paladin-ubuntu:~$ sudo ifconfig wlan0 up
paladin@paladin-ubuntu:~$ sudo iwconfig wlan0
wlan0 IEEE 802.11abgn ESSID:"rlc"
Mode:Managed Frequency:2.462 GHz Access Point: Not-Associated
Tx-Power=15 dBm
Retry min limit:7 RTS thrff Fragment thr=2352 B
Encryption key: off
Power Management: off
Link Quality:0 Signal level:0 Noise level:0
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

Now if i try and get a dhcp assigned IP the following is the output:

paladin@paladin-ubuntu:~$ sudo dhclient wlan0
Internet Systems Consortium DHCP Client V3.1.1
Copyright 2004-2008 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

wmaster0: unknown hardware address type 801
wmaster0: unknown hardware address type 801
Listening on LPF/wlan0/00:1f:3b:2a:6b:6b
Sending on LPF/wlan0/00:1f:3b:2a:6b:6b
Sending on Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 6
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 10
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 11
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 15
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 11
No DHCPOFFERS received.
No working leases in persistent database - sleeping.

Now I now this is a long post I am trying to get as much information to you guys as possible so please bear with this last bit of data now as I said earlier I am able to connect with the GUI, when I do this here is the output from iwconfig:

wlan0 IEEE 802.11abgn ESSID:"rlc"
Mode:Managed Frequency:2.462 GHz Access Point: 00:19:70:05:07:54
Bit Rate=1 Mb/s Tx-Power=15 dBm
Retry min limit:7 RTS thrff Fragment thr=2352 B
Encryption keyff
Power Managementff
Link Quality=100/100 Signal level:-42 dBm Noise level=-127 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

Any help on this problem will be very appreciated, kinds regards

Louis
 
Old 11-23-2009, 02:42 PM   #2
minrich
Member
 
Registered: Aug 2003
Location: Isles of Man & Wight
Distribution: See signature
Posts: 548

Rep: Reputation: 40
Hi - since Ubuntu is based on Debian please read http://wiki.debian.org/iwlwifi

Next, and please note I don't have one, the intel 4965 doesn't support mode: Master, that is reserved for your access point, try setting the non-GUI machine to Managed.

I am confused by your posting above, do you have the same user name and hostname on both machines? Perhaps you can edit your post to insert Machine0: for the no-GUI and Machine1: for the GUI machine before the output of your various commands - so that I know which is reporting what.
 
Old 11-23-2009, 03:23 PM   #3
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
Make sure that NetworkManagers are not working. It may cause a problem.

Second, to associate with AP you need to give only ESSID.
sudo iwconfig wlan0 essid rlc
sudo ifconfig wlan0 up
 
  


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
Connect To Unprotected HotSpot Using Only Command Line nythacker Linux - Wireless Networking 5 03-13-2009 12:17 PM
How to connect to computers via command line? Micro420 Linux - Networking 9 03-01-2006 01:17 AM
connect to internet using command line ic_torres Slackware 5 12-05-2005 04:35 AM
How can I connect to my local machine using FTP at the command line? imagirlgeek Linux - Newbie 12 08-26-2004 02:57 PM
Command line direct connect client? Lenny Linux - Software 1 09-22-2003 01:41 AM

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

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

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