Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

how to connect to wireless AP from CLI

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
squiddy
Posts: 14
Joined: 2009-12-11 04:59

how to connect to wireless AP from CLI

#1 Post by squiddy »

hi, i know we already have network manager, but i'm curious about how to connecting my latop to any weireless AP from CLI.

thank you.

User avatar
aspnair
Posts: 1247
Joined: 2009-06-18 12:27
Location: Twitter: @anand_sivaram

Re: how to connect to wireless AP from CLI

#2 Post by aspnair »

For example for interface wlan0, using wep/no security

iwlist wlan0 scan (to scan the available networks)
iwconfig wlan0 essid <essid of network>
iwconfig wlan0 mode managed
iwconfig wlan0 channel N (optional)
iwconfig wlan0 rate 54M (optional to set 54mbps, or anything else)
iwconfig wlan0 key <wep key> (optional in case of wep encryption, no need for no security)
iwconfig wlan0 ap <mac address of the ap> (optional)
After the required settings try
iwconfig
See whether it is associated with the specified access point.

Now you could use ifconfig to set static/dhcp address
Compressed Air Energy Storage, Entropy and Efficiency
http://saurorja.org/2012/06/18/compress ... fficiency/

squiddy
Posts: 14
Joined: 2009-12-11 04:59

Re: how to connect to wireless AP from CLI

#3 Post by squiddy »

is it also works for WPA2 personal encryption ?

thank you by the way

User avatar
aspnair
Posts: 1247
Joined: 2009-06-18 12:27
Location: Twitter: @anand_sivaram

Re: how to connect to wireless AP from CLI

#4 Post by aspnair »

I did not try wpa2 from command line. But you may try with wpa_supplicant
But this is what I did in /etc/network/interfaces. My access point is configured with WPA2 with AES encryption

Code: Select all

auto wlan0
iface wlan0 inet dhcp
wpa-ssid <essid>
wpa-bssid <mac address of the ap>
wpa-psk <wpa key>
wireless-mode managed
wireless-txpower <txpower in dbm, optional>
wireless-rate <rate like 11M, 54M, optional>
wpa-key-mgmt WPA-PSK
wpa-pairwise TKIP CCMP
Compressed Air Energy Storage, Entropy and Efficiency
http://saurorja.org/2012/06/18/compress ... fficiency/

User avatar
julian67
Posts: 4633
Joined: 2007-04-06 14:39
Location: Just hanging around
Been thanked: 7 times

Re: how to connect to wireless AP from CLI

#5 Post by julian67 »

You could also try ceni, a very neat network connection manager with ncurses interface. It isn't in Debian but you can find it in Sidux repos i.e. http://debian.tu-bs.de/project/sidux/de ... in/c/ceni/

You can read something about it and see some screenshots at http://manual.sidux.com/en/internet-con ... cardconfig

I have used earlier versions (2.3 and 2.5) and found it very good.

Alternatively if you have network-manager installed there are now some command line clients for it such as network-manager-cli and cnetworkmanager (I didn't try either yet).

edit: wicd also has a full console interface
Wisdom from my inbox: "do not mock at your pottenocy"

squiddy
Posts: 14
Joined: 2009-12-11 04:59

Re: how to connect to wireless AP from CLI

#6 Post by squiddy »

thank you julain87 & aspnair :)

Post Reply