Wednesday, August 27, 2008

Configuring Ubuntu Wireless Networking with Command-Line Tools

The wireless-tools package, which is installed on Ubuntu systems by default, provides several commands for probing and configuring wireless interfaces and networks. You can execute the man wireless command to get information about the wireless-tools package, learn how and where it is installed by various Linux distributions, and view a list of the commands that this package provides. The wireless-tools commands that I find most valuable are the iwconfig and iwlist commands.

The iwconfig command displays information much like the ifconfig command, providing information about the wireless status of all or specific Ethernet interfaces on a system. The following example shows the output of the iwconfig command, querying the wireless Ethernet interface that was installed

$ iwconfig wlan0
wlan0 IEEE 802.11-DS ESSID:”wvh” Nickname:”okuwlan”
Mode:Managed Frequency:2.427 GHz Access Point:
00:03:93:E9:89:22
Bit Rate:11 Mb/s Tx-Power=15 dBm
Retry limit:8 RTS thr=1536 B Fragment thr=1536 B
Power Management:off
Link Quality=0/0 Signal level=95/255 Noise level=0/0
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

As you can see, this provides much of the same information as that provided by the ifconfig command, but it also includes wireless-specific information. The iwconfig command can also be used to set various wireless configuration options from the command line—see the online man page for iwconfig (using the command man iwconfig) for more information.

The iwlist command enables you to scan for wireless networks and examine various characteristics of a wireless interface. For example, scanning for wireless networks around my home using the iwlist wlan0 scan command displays the following information:

$ sudo iwlist wlan0 scan
wlan0 Scan completed :
Cell 01 - Address: 00:03:93:E9:89:22
ESSID:”wvh”
Mode:Master
Channel:4
Encryption key:off
Quality:0/0 Signal level:38/255 Noise level:0/0
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s

This command is useful for verifying that a wireless interface is actually working, and that it can communicate with an access point. The information produced by the iwlist command is much more interesting in public areas, where you will usually detect multiple wireless networks, as in the following example from one of my laptops while I was on vacation:

$ sudo iwlist eth0 scan
Password:
eth0 Scan completed :

Cell 01 - Address: 00:09:5B:36:22:38
ESSID:”Wireless”
Mode:Master
Frequency:2.412 GHz (Channel 1)
Signal level:20/153 Noise level:12/153
Encryption key:off
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s

Cell 02 - Address: 00:12:17:A6:E8:CC
ESSID:”linksys”
Mode:Master
Frequency:2.437 GHz (Channel 6)
Signal level:83/153 Noise level:13/153
Encryption key:off
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s

Cell 03 - Address: 00:12:17:A6:E8:CC
ESSID:”linksys”
Mode:Master
Frequency:2.437 GHz (Channel 6)
Signal level:81/153 Noise level:13/153
Encryption key:off
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s

Cell 04 - Address: 00:12:17:79:CF:D3
ESSID:”linksysR79cfd3”
Mode:Master
Frequency:2.437 GHz (Channel 6)
Signal level:49/153 Noise level:13/153
Encryption key:off
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18Mb/s;24 Mb/s; 36 Mb/s; 54 Mb/s

In this case, the information provided by the iwlist command was very useful in identifying available wireless access points, their names, and whether they were configured for authentication/encryption. The iwlist command can also query specific wireless configuration details.

>>> Read more about Overview of Wireless Technologies <<<

Source of Information : Ubuntu Linux - Bible

No comments: