Difference between revisions of "Configuring wireless interfaces"

From Notes_Wiki
(Created page with "=Configuring wireless interfaces= To configure wireless interfaces in Linux one can use combination of '<tt>ifconfig</tt>', '<tt>iwconfig</tt>' and '<tt>iwlist</tt>' commands...")
(No difference)

Revision as of 12:47, 9 November 2012

Configuring wireless interfaces

To configure wireless interfaces in Linux one can use combination of 'ifconfig', 'iwconfig' and 'iwlist' commands. 'ifconfig' or 'dhclient' can be used to configure IP address for interface or to make interface up so that we can use 'iwconfig' or 'iwlist' command for given interface. 'iwconfig' command can be used to configure frequency/channel, power, ssid, encryption key etc. for wireless interface. 'iwlist' helps in scanning for available networks and also helps in listing supported frequencies and channels of available network adapters.

Example script used to configure wireless interface at staff quarters is:

#!/bin/bash
sudo ifconfig wlan0 up
sudo iwconfig wlan0 essid <SSID>
sudo iwconfig wlan0 key <KEY>
sudo iwlist scanning wlan0
sudo iwconfig wlan0 channel 5
sudo iwconfig ap 00:0D:54:98:7C:85
sudo dhclient -v wlan0

Note:

  • Channel, essid, key, ap, etc. values will change as per scenario and most of these (except key offcourse) can be found using 'iwlist scanning' command.
  • 128-bit hex Key should be written in following format 'aaaa-bbbb-cccc-dddd-eeee-ffff-gg'