Using Linux Ubuntu for the last 2 days..

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

drag

Elite Member
Jul 4, 2002
8,708
0
0
Alright... Still haven't had a chance to realy look at Ubuntu, but this should work.

To troubleshoot wireless connections..

You have several things going on.
command line utilities for managing interfaces:
ifconfig -- for standard network device configuration
iwconfig -- for wireless extensions configuration
dmesg -- for viewing kernel log
iwlist -- scanning networks and such.
rmmod -- unloads kernel modules
modprobe -- loads kernel modules

Removing modules will help you 'reset' hardware sometimes, but it can be dangerous if the module isn't a good one.

Then you have two or three major componates involved...
wpasupplicant -- daemon and utilties designed to make it possible to scan and connect to varous newtorks.
There are utilities for creating configurations and such, but I prefer to edit the stuff by hand.

Check out /usr/share/doc/wpasupplicant for readme and example configuration.

NetworkManager -- a atempt to make Linux wireless networking 'easy'. It uses wpasupplicant to do it's dirty work.
Uses dbus and the applet front end for your toolbar is nm-applet
If you configure something manually either through the gnome network configuration stuff or (I prefer) to edit the /etc/network/interfaces file directly then network manager should ignore it.

In Debian there are extra hooks for the interfaces files that can use wpasupplicant directly. This way you can manually setup specific configurations for various networks and be able to run scripts depending on what connection your making. I don't know if they are present in Ubuntu.

For troubleshooting you want to disable network manager so that it doesn't interfer with what your trying to do. You can do that with:
/etc/dbus-1/event.d/25NetworkManager stop

I _beleive_. Personally I just uninstall it.

How it would go, idealy, if your going to configure the system manually you'd do something like this:

1. Figure out the name of the device your dealing with.
You can do that by:
iwconfig
and it will show you what devices support wireless extensions. We will assume it's wlan0

2. disable networkmanager and such things.
/etc/dbus-1/event.d/25NetworkManager stop
/etc/init.d/wpasupplicant stop

If the interface has been staticly configured bring it down;
ifdown wlan0

To make sure it's down
ifconfig wlan0 down

3. Now bring the interface back up.

ifconfig wlan0 0.0.0.0 up

4. Check dmesg for anything.
dmesg

Usually the devices will often just associate with a open ap by themselves. if they fail in their asociation then this is a problem and they probably won't work. Try taking down the device, rmmod'ng and modprobe'ing the driver, and trying again to wake the device up.

5. look for wireless networks. For troubleshooting you probably want to use a open access point first then worry about security keys and such after you know that that works.

iwlist wlan0 scan

6. Try to associate with one if it hasn't happenned already.

Using the settings for the networks detected...

iwconfig wlan0 rate 2M
iwconfig wlan0 essid "blah"
(run dmesg to see if it's associated yet or if you have any errors)
iwconfig wlan0 ap 12:23:45:56:78:ab:cd
(run dmesg to see if it's associated yet or if you have any errors)
iwconfig wlan0 channel 11
(run dmesg to see if it's associated yet or if you have any errors)

see also the notes in step 4.

7. Use dhclient to pull a lease. There are other dhcpclients, I am not sure which ones are aviable by default. But assuming it's dhclient...

dhclient wlan0

I know that with my broadcom card this is were I'd get into problem. Dhclient brings down the interface and brings it back up quickly so that can cause 'issues' with that paticular driver. Seemed only to affect me on specific networks.

Some cards, like if you have a driver that uses 'dscape' or are using the rt2x00 drivers for ralink cards have special configuration utilities that you need to use for them.

Wpasupplicant has support for dscape extensions, you may need to recompile that to work and what I outlined above won't work with them. The rt2x00 drivers have their own special gui they made that will probably be easier to use then using the default stuff ubuntu provides.

Hope that helps somewhat.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
I just hope it's accurate. It would be nice if somebody with Ubuntu made sure the commands worked.
 

Robor

Elite Member
Oct 9, 1999
16,979
0
76
Originally posted by: drag
I just hope it's accurate. It would be nice if somebody with Ubuntu made sure the commands worked.

I've got Ubuntu on 2 systems here but all of our access points in the office use proprietary wireless encryption. Depending on time I should be able to try at home over the weekend.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
I might be able to try the wireless commands later.

Over all they look accurate, as in they're similar enough to what I did in edgy and feisty the few times I've connected to a WAP (I've got 4 (working) in the apartment and another ~18 available ;), you'd think I'd use them more).