LinuxQuestions.org
Register a domain and help support LQ
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 03-04-2009, 01:29 PM   #1
nythacker
LQ Newbie
 
Registered: Jan 2006
Distribution: Ubuntu 8.04 "Hardy Heron"
Posts: 7

Rep: Reputation: 0
Question Connect To Unprotected HotSpot Using Only Command Line


Hi,

Can anybody show me how to search and connect to an unprotected/open wifi hotspot (e.g. Internet Cafe, hotels, airports, etc.) using only the command line?

I'm using Ubuntu 8.04 (a.k.a "Hardy Heron")

Any help would be greatly appreciated. Thanks!
 
Old 03-05-2009, 06:39 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,398

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
just use the iwconfig tool to set your AP, and iwlist to find available hotspots. Once you're associated you'd normally then run a dhcp client against the interface to get an ip.
 
Old 03-05-2009, 06:44 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
These commands can be tricky. I have found that I often have to run iwconfig, then do "ifconfig wlan0 down", then bring it up again, then maybe run iwconfig again. I have no idea what is going on in the background, but GUI front ends such as WICD seem to work pretty seamlessly.
 
Old 03-05-2009, 08:01 AM   #4
nythacker
LQ Newbie
 
Registered: Jan 2006
Distribution: Ubuntu 8.04 "Hardy Heron"
Posts: 7

Original Poster
Rep: Reputation: 0
I did some research and found that you first need to use the command

Code:
sudo iwlist [interface] scan
to be able to find available wireless networks within your area.

Then you use a series of iwconfig commands to configure your wireless interface to point to one of the wireless networks found by the iwlist [interface] scan command.

Then you finally issue the command

Code:
sudo dhclient [interface]
to get an IP Address from the selected wireless network.


My question now is what essential iwconfig commands are needed to configure my wireless interface to connect to the open/unprotected wireless network or hotspot.

Thanks.

Last edited by nythacker; 03-05-2009 at 08:06 AM.
 
Old 03-05-2009, 08:13 AM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Quote:
Originally Posted by nythacker View Post
My question now is what essential iwconfig commands are needed to configure my wireless interface to connect to the open/unprotected wireless network or hotspot.

Thanks.
Good to see the quick learning.....

In your problem statement, "essential" means that you have to know "enough" to connect to the hotspot. If it is not protected, then normally all you need is the essid. If this is not hidden, then you will get it from "iwlist ... scan".

Best case example:
iwlist wlan0 scan ##finds one open hotspot with essid = "fred" (and adequate signal strength)
iwconfig wlan0 essid fred
dhclient (or dhcpcd wlan0)
 
Old 03-13-2009, 12:17 PM   #6
nythacker
LQ Newbie
 
Registered: Jan 2006
Distribution: Ubuntu 8.04 "Hardy Heron"
Posts: 7

Original Poster
Rep: Reputation: 0
Thumbs up

Quote:
Originally Posted by pixellany View Post
Good to see the quick learning.....

In your problem statement, "essential" means that you have to know "enough" to connect to the hotspot. If it is not protected, then normally all you need is the essid. If this is not hidden, then you will get it from "iwlist ... scan".

Best case example:
iwlist wlan0 scan ##finds one open hotspot with essid = "fred" (and adequate signal strength)
iwconfig wlan0 essid fred
dhclient (or dhcpcd wlan0)

Thank you so much, Pixellany. Your solution worked on mine...
 
  


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
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
can linux connect to a hotspot? sublyme718 Linux - Wireless Networking 1 11-08-2005 12:07 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


All times are GMT -5. The time now is 07:03 PM.

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