2009
08.16

Ubuntu Wireless via Command Line

Enable your wireless device:
ifconfig
ifconfig wlan0 up

List the available wireless access points:
iwlist

Configure your wireless connection:
iwconfig

Get your IP address via dhcp:
dhclient

Scan for wireless networks:
iwlist wlan0 scan

Configure your wireless connection:
iwconfig wlan0 essid NETWORK_ID key WIRELESS_KEY

To configure a wireless connection with an ascii key:
iwconfig wlan0 essid NETWORK_ID key s:WIRELESS_KEY

What is my wireless IP? Use this command:
dhclient wlan0

Lets create a wireless script:

gedit, nano or vi wifi_up.sh

Type in these contents:


#! /bin/bash
ifconfig wlan0
iwconfig wlan0 essid NETWORK_ID key WIRELESS_KEY
dhclient wlan0

Lets set it up with the proper permissions and make it executable:

chmod u+x wifi_up.sh

Then. #cp wifi_up.sh /usr/bin/

Now if you ever need to get your wireless up. Just simply run the command.
wifi_up

No Comment.

Add Your Comment

You must be logged in to post a comment.