Requirements
- An Ubuntu PC and Internet connection (Ethernet).
+ Tested version: Ubuntu 14.04
- A WIFI network card.
- A WIFI Router that offers DHCP IP address.
Choose your network and carry on.
1. Open WIFI Network (No password):
2. WEP WIFI Network:Code:$ ifconfig wlan0 down $ dhclient wlan0 -r $ ifconfig wlan0 up $ iwconfig wlan0 essid "your_essid" $ iwconfig wlan0 mode Managed $ dhclient wlan0
3. WPA/WPA2 WIFI Network:Code:$ ifconfig wlan0 down $ dhclient wlan0 -r $ ifconfig wlan0 up $ iwconfig wlan0 essid "essid" $ iwconfig wlan0 mode Managed $ iwconfig wlan0 key hexadecimal_key OR $ iwconfig wlan0 key s:ascii_key $ dhclient wlan0
This is a little bit different method. First, you have to install wpasupplicant package:
Next, create a file that we'll call "wireless-wpa.conf":Code:$ sudo apt-get install wpasupplicant
Now, write the following code inside:Code:$ sudo nano wireless-wpa.conf
Save the file. Now execute the following:Code:ctrl_interface=/var/run/wpa_supplicant network={ ssid="the_router_ssid" scan_ssid=1 key_mgmt=WPA-PSK psk="the_wpa_key" }
$ wpa_supplicant -B -Dwext -i wlan0 -c ./wireless-wpa.confCode:$ ifconfig wlan0 down $ dhclient wlan0 -r $ ifconfig wlan0 up $ iwconfig wlan0 mode Managed $ killall wpa_supplicant $ wpa_supplicant -B -Dwext -i wlan0 -c ./wireless-wpa.conf -dd
-B means run wpa_supplicant in the background.
-D specifies the wireless driver. wext is the generic driver.
-c specifies the path for the configuration file.
Obtain IP address by DHCP
Use the ip command to verify the IP address assigned by DHCP.Code:$ sudo dhclient wlan0
that's all!!Code:$ ip addr show wlan0




Reply With Quote

Bookmarks