LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Home Forums HCL Reviews 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 09-02-2008, 07:46 PM   #1
SlipDigby
LQ Newbie
 
Registered: Sep 2008
Posts: 4

Rep: Reputation: 0
WIFI Connecting via Commandline


Hi,

I am fairly new to commandline in shell but have been learning a fair bit already. One problem that's been bothering me though is how to connect to my access point through my wlan0 via the command line. How do I go about establishing that connection?
 
Old 09-02-2008, 08:24 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
You haven't provided a lot of details. You can control a wireless device directly with "iwconfig". This program is similar to ifconfig, but you can also set the channel, ssid, etal. For wireless encryption, wpa_supplicant is used.

Normally the information needed for these two programs are contained in the /etc/sysconfig/network/ifcfg-wlan0 file, including the PSK. Editing the file with the correct values and running "ifup-wlan0" will connect you to your AP.

Your system may use a different location for the ifcfg-<device> files. Maybe /etc/sysconfig/networking/ for example.

On some systems, a script in /etc/ somewhere will contain iwconfig & ifconfig commands when you boot and the config file may not be used.

These programs, and even the config files have their own manpages. "man ifcfg" for example will provide information on what the config file contains.

Last edited by jschiwal; 09-02-2008 at 11:28 PM. Reason: fixed typo
 
Old 09-03-2008, 01:05 PM   #3
SlipDigby
LQ Newbie
 
Registered: Sep 2008
Posts: 4

Original Poster
Rep: Reputation: 0
All I want to be able to do is establish a connection with an AP via commandline rather than through a Wireless Assistant GUI. I guess it is not that simple via commandline and there is no one-line command that will just connect as I am expecting. I guess I need to search and read up on how NIC connect to AP's to better understand the process.
 
Old 09-03-2008, 02:24 PM   #4
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,087

Rep: Reputation: 407Reputation: 407Reputation: 407Reputation: 407Reputation: 407
As jschiwal says, you "haven't provided a lot of details".

Please tell us your distro, or even better, edit your LQ profile (at the left, see mine? The link is to the right - under "My LQ") so it tells us, as different distros do networking completely differently from the command line.
Quote:
All I want to be able to do is establish a connection with an AP via commandline rather than through a Wireless Assistant GUI. I guess it is not that simple via commandline and there is no one-line command that will just connect as I am expecting
It's usually very simple, and I do it all the time with just a one-line command, but we need to know your distro (Eg Ubuntu 8.04, or whatever, NOT just "lunux 5" (sic)) to be able to help you help yourself.

Please read this: http://www.linuxsilo.net/docs/smart-questions_en.html (no offence intended).
 
Old 09-23-2008, 01:34 AM   #5
csanchisb
LQ Newbie
 
Registered: Jun 2004
Distribution: Opensuse 11
Posts: 22

Rep: Reputation: 15
The one-line command

Quote:
Originally Posted by tredegar View Post
It's usually very simple, and I do it all the time with just a one-line command
Do you? I have been using Linux for years now and I still haven't figured out how, regardless of the distro. By the way, in my case that's Opensuse 11, although iwconfig, networkmanager and such commands aren't distro-specific at all... Anyway, I would really appreciate it if you could tell me your one-line command (whatever distro you're using). Thanks.
 
Old 09-23-2008, 03:57 AM   #6
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,087

Rep: Reputation: 407Reputation: 407Reputation: 407Reputation: 407Reputation: 407
Quote:
I have been using Linux for years now and I still haven't figured out how, regardless of the distro.
Then you probably need to start reading here:
http://www.linuxhomenetworking.com/w...ess_Networking

Note that the commands are essentially the same across distros, but the configuration files have two systems / locations - the Fedora / RedHat system and the Debian / Ubuntu system. I think Suse follows the former, but you'll soon find out.

Once the configuration files are correct, the one-liner to use (as root) is

ifup name_of_wireless_interface eg
Code:
ifup eth1
 
  


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
Connecting to wifi birddseedd Linux - Wireless Networking 2 02-13-2007 11:45 AM
Wifi Connecting to Random Networks... Mithic Linux - Wireless Networking 2 11-28-2006 05:23 PM
wifi connecting Nostur Linux - Wireless Networking 3 09-08-2006 02:12 PM
Connecting to WiFi fails Ubuntu 3 10-07-2005 02:25 PM
Pureftpd + xinetd: Writes pureftpd commandline to client when connecting bomix Linux - Software 2 03-29-2005 10:21 PM

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

All times are GMT -5. The time now is 10:59 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration