Thursday, October 9, 2014

Configure Wireless Network: Edit /etc/network/interfeces of Ubuntu 14.04

To discover the available wireless interfaces
$sudo lspci |grep Wireless
$sudo lspci |grep Network


To discover the available wireless networks
$sudo iwlist wlan0 scan

To ask the wireless interface to associate with an identified access point
$sudo iwconfig wlan0 essid

If there is an encryption to supply the secret key [Assume WEP]
$sudo iwconfig wlan0 key

Now to ask for an ip address
$sudo dhclient wlan0

Or else to manualy configure the interface
$vi /etc/network/interfeces

The configuration for wireless interface with a dynamic IP address File: /etc/network/interfeces
----------
----------
auto wlan0
iface wlan0 inet dhcp
     wpa-ssid
     wpa-psk


The configuration for wireless interface with a static IP address File: /etc/network/interfeces
----------
----------
auto wlan0
iface wlan0 inet static
        address 192.168.2.185
        netmask 255.255.255.0
        gateway 192.168.2.1
        network 192.168.2.0
     broadcast 192.168.2.255
     dns-nameserver 8.8.8.8
     wpa-ssid

     wpa-psk


Note: Auto tag is to automatically start and connect to the wireless network.

To stop and start the wireless interface
$sudo ifdown wlan0
$sudo ifup -v wlan0

0 comments: