How to troubleshoot wireless networking in Ubuntu Linux

Posted on 9:24 PM by Bharathvn

If you need help determining exactly what wireless card you have, type the following:

$ lspci | grep -i wireless Search for wireless PCI cards
01:09.0 Network controller: Broadcom Corporation BCM4306 802.11b/g
Wireless LAN Controller (rev 03)

Assuming that your wireless card is up and running, there are some useful commands
in the wireless-tools package you can use to view and change settings for your wireless cards. In particular, the iwconfig command can help you work a with your wireless LAN interfaces. The following scans your network interfaces for supported wireless cards and lists their current settings:

$ iwconfig
eth0 no wireless extensions.
eth1 IEEE 802.11-DS ESSID:”” Nickname:”BHARATHVN”
Mode:Managed Frequency:2.457 GHz Access Point: Not-Associated
Bit Rate:11 Mb/s Tx-Power=15 dBm Sensitivity:1/3
Retry limit:4 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off

Wireless interfaces may be named wlanX or ethX, depending on the hardware and
driver used. You may be able to obtain more information after setting the link up on
the wireless interface:

$ ip link set eth1 up

$ iwconfig eth1
eth1 IEEE 802.11-DS ESSID:”” Nickname:”BHARATHVN”
Mode:Managed Frequency:2.457 GHz Access Point: None
Bit Rate:11 Mb/s Tx-Power=15 dBm Sensitivity:1/3
Retry limit:4 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=0/92 Signal level=134/153 Noise level=134/153
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

The settings just shown can be modified in a lot of ways. Here are some ways to use
iwconfig to modify your wireless interface settings. In the following examples, we operate on a wireless interface named wlan0. These operations may or may not be supported, depending on which wireless card and driver you are using.

$ sudo iwconfig wlan0 essid “MyWireless” Set essid to MyWireless

$ sudo iwconfig wlan0 channel 3 Set the channel to 3

$ sudo iwconfig wlan0 mode Ad-Hoc Change from Managed to Ad-Hoc mode

$ sudo iwconfig wlan0 ap any Use any access point available

$ sudo iwconfig wlan0 sens -50 Set sensitivity to –50

$ sudo iwconfig wlan0 retry 20 Set MAC retransmissions to 20

$ sudo iwconfig wlan0 key 1234-5555-66 Set encryption key to 1234-5555-66

The essid is sometimes called the Network Name or Domain ID. Use it as the common
name to identify your wireless network. Setting the channel lets your wireless
LAN operate on that specific channel. With Ad-Hoc mode, the network is composed of only interconnected clients with no central access point. In Managed/Infrastructure mode, by setting ap to a specific MAC address, you can force the card to connect to the access point at that address, or you can set ap to any and allow connections to any access point. If you have performance problems, try adjusting the sensitivity (sens) to either a negative value (which represents dBm) or positive value (which is either a percentage or a sensitivity value set by the vendor). If you get retransmission failures, you can increase the retry value so your card can send more packets before failing. Use the key option to set an encryption key. You can enter hexadecimal digits (XXXXXXXX-XXXX-XXXX or XXXXXXXX). By adding an s: in front of the key, you can enter an ASCII string as the key (as in s:My927pwd).