how to connect to wireless AP from CLI

New to Debian (Or Linux in general)? Ask your questions here!

how to connect to wireless AP from CLI

Postby squiddy » 2010-01-14 21:42

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.
squiddy
 
Posts: 14
Joined: 2009-12-11 04:59

Re: how to connect to wireless AP from CLI

Postby aspnair » 2010-01-15 02:06

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/
User avatar
aspnair
 
Posts: 1247
Joined: 2009-06-18 12:27
Location: Twitter: @anand_sivaram

Re: how to connect to wireless AP from CLI

Postby squiddy » 2010-01-15 04:59

is it also works for WPA2 personal encryption ?

thank you by the way
squiddy
 
Posts: 14
Joined: 2009-12-11 04:59

Re: how to connect to wireless AP from CLI

Postby aspnair » 2010-01-15 06:35

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
aspnair
 
Posts: 1247
Joined: 2009-06-18 12:27
Location: Twitter: @anand_sivaram

Re: how to connect to wireless AP from CLI

Postby julian67 » 2010-01-15 09:49

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/debian/pool/main/c/ceni/

You can read something about it and see some screenshots at http://manual.sidux.com/en/internet-connecting-en.htm#netcardconfig

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"
User avatar
julian67
 
Posts: 4648
Joined: 2007-04-06 14:39
Location: Just hanging around

Re: how to connect to wireless AP from CLI

Postby squiddy » 2010-01-15 11:40

thank you julain87 & aspnair :)
squiddy
 
Posts: 14
Joined: 2009-12-11 04:59


Return to Beginners Questions

Who is online

Users browsing this forum: anatak and 6 guests

fashionable