Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-27-2006, 10:01 PM   #1
Registered: Aug 2005
Posts: 298

Rep: Reputation: 30
wireless linux via command line

As most things I'am learning how to use command line for just about anything. I have noticed though that command line programs have fewer bugs than gui that is why I'm asking how to connect to the internet using a wireless card and WPA security from the command line.

My specs: kubuntu

Currently I use nm-applet. Its ok but it has some bugs that I learned to work around e.g. before suspending to remove the network card and put it back when resumed. Also remove network card for a minute if something happens then put it back and connect using nm-applet.

I would like to try the command line and see maby if this is likely to be avoided And I don't like how it tries to automaticly connect.

Thank you
Old 12-27-2006, 10:27 PM   #2
Registered: Feb 2006
Location: somewhere in cyberspace
Distribution: Debian, Familiar
Posts: 380

Rep: Reputation: 30
Assuming you have already configured WPA from the GUI and it works (i.e. /etc/wpa_supplicant.conf exists and is properly written), then configuring it to start and stop from the command-line is a breeze. Simply edit your /etc/network/interfaces file and add this under your wireless network interface:

up wpa_supplicant -i<interface> -c/etc/wpa_supplicant.conf -Bw
down killall wpa_supplicant

Here, replace <interface> with your NIC's network interface. For example, here's my configuration (my wireless NIC interface is eth2)

iface eth2 inet dhcp
up wpa_supplicant -ieth2 -c/etc/wpa_supplicant.conf -Bw
down killall wpa_supplicant
Now, whenever you bring up your wireless card, WPA will start automatically. Whenever you shut it down, WPA will stop automatically. You can do this from the command-line with "sudo ifup <interface>" and "sudo ifdown <interface>", where <interface> is your wireless interface (with my config, this would be eth2).

Last edited by pda_h4x0r; 12-27-2006 at 10:28 PM.


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
scripts (kommander and command line) to start wireless devices with wpa/wpa2/wpa-aes Fluxx Linux - Wireless Networking 4 06-28-2010 02:51 AM
Can't activate wireless card from command line jdrietz Slackware 21 02-01-2006 11:57 PM
I want to use command line with Linux ywergs Fedora 7 10-01-2005 09:56 PM
Command Line On Linux??? unwrittenlaw Linux - Newbie 7 11-25-2003 12:59 AM
Command Line Linux Fusion07 Linux - Newbie 6 07-03-2002 12:47 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:58 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration