Tuesday, January 3, 2012

How to connect WiFi using command line Ubuntu

For example
  - wifi name: CSS
  - Password: 20091
  - wifi interface in ubuntu: wlan0

1- list available wifi network
#iwlist wlan0 scan

2- set all information in order to connect to wifi
#iwconfig wlan0 essid CSS
#iwconfig wlan0 key s:20091

s: = for ASCII password
xxxx-xxxx-xxx   = for hexadecimal passsword

3- turn off and on the wifi interface to make it connect to wifi network

#ifconfig wlan0 down
#ifconfig wlan0 up

4- configure ip address on for the wireless
  - dynamic configure IP address through dhcp
  #dhclient wlan0
  - static configure you have to edit /etc/network/interface

If it is successfully connected when we list wifi interface, we will see it associate with AP, using command #iwconfig wlan0

No comments:

Post a Comment