Skip navigation.

My Wi-Fi on Linux - Return of the Wi-Fi

, , ,

Note: this post was intended to be written and posted circa 2008-07-19, but I left it half-written for about one month.

So, as you can read on my previous post, I've installed the brand-new 2.6.26 linux kernel. And then the older nvidia drivers didn't want to compile, so I was forced to update them. And finally I could put my Wi-Fi card in ad-hoc mode.

But does it work?

Does it work? Bah, that doesn't matter. What everybody wants to know is: will it blend? :D

Serious answer: yes, it works! :yes:

I can confirm that I can now configure an ad-hoc network on my desktop (with a Ralink RT2561 PCI card) using rt61pci driver from rt2x00 family.

And, yes, I can finally connect my notebook to my desktop using Wi-Fi! And since my desktop is my router, this means that I can finally access internet without the need of that annoying blue ethernet cable running from one room to another.

Ad-hoc network? What about that access point mode?

Well, ad-hoc mode is "enough" for me, or enough for now, but it is still not what I really want. I want to configure my desktop as a wireless access point. However, doing so will require some more work (I need to find out what programs I must install and how to configure them) and I might have trouble with driver bugs (as I pointed out in a previous post).

This ad-hoc network is just a first step, and I'm looking forward the next step: building an access point. But I don't plan trying this anytime soon. This ad-hoc network seems to fit my needs pretty well, and I have many other things to do.

The configuration

At my desktop
I've just added the following lines to my /etc/conf.d/net:
config_wlan1=( "10.0.1.1/24 brd 10.0.0.255" )
essid_wlan1="denilson"
mode_wlan1="ad-hoc"
channel_wlan1="11"
It is worth noting that both ifconfig and iwconfig display two interfaces: wmaster0 and wlan1. The first one (wmaster0) exists for some reason but we don't use. The "real" interface that we actually use and configure is wlan1.

For "bonus", I've also configured a DHCP server (dhcpd) listening to wlan1 (in addition to eth1). And yes, it works even over ad-hoc network. If you think for a while, there is no reason to not work, because DHCP works at a network layer above Wi-Fi connection.

At my notebook
My notebook has a Intel PRO/Wireless 3945ABG Wi-Fi card, which works with the native iwl3945 module (and it requires a binary firmware package in order to work).

These are the contents of /etc/conf.d/net from my notebook:
# Disabling zeroconf (IPV4LL) thing.
dhcpcd_eth0="-L"
dhcpcd_wlan0="-L"

#modules_eth0=( "!plug" )

# Disabling NTP and NIS
dhcp_eth0="nontp nonis"
dhcp_wlan0="nontp nonis"

# wpa_supplicant rocks! I'm not going back to iwconfig anymore! :)
modules=( "wpa_supplicant" )
The first lines disable that feature that always set an IP address to the interface, regardless if there is a DHCP server or not. While this feature is useful for some quick networks (specially alongside Windows computers), it is usually annoying, because the interface will always appear to be up and with no problems, making it harder to see network problems and harder to debug them.

The "!plug" line is there to remember me how to disable netplug, as sometimes it can be annoying (mostly when testing and debugging network connections), but it usually is a good thing to have (because I can just plug the cable and the ethernet interface will be up).

Then I disable overwriting NTP and NIS configurations by the DHCP client. In other words, it means: "DCHP client, please give me an IP address and some DNS servers, but don't ever mess with my carefully hand-tuned NTP settings. Also, don't mess with NIS settings, because I know better than you that I don't need it."

Finally, I tell Gentoo to use wpa_supplicant to configure my Wi-Fi card. I've found that wpa_supplicant was a lot easier to configure (/etc/wpa_supplicant/wpa_supplicant.conf, plus a graphical tool called wpa_gui) and it worked pretty well on all Wi-Fi networks I've encountered, except... my own network.

That's true. For some reason, I could not make wpa_supplicant-0.5.7 (which is the latest stable version on Gentoo, and the 0.6.3 version is hard-masked) connect to my ad-hoc network. wpa_supplicant can detect that my network is available (with IBSS flag, which means the network is ad-hoc), tries to connect, but for some reason it can't connect.

Since I could not make wpa_supplicant work for my own network, whenever I am at home I comment out that wpa_supplicant line and uncomment the following lines:
essid_wlan0="denilson"
mode_wlan0="ad-hoc"
channel_wlan0="11"
Note that I don't set any IP on my notebook, because my desktop automatically gives an IP via DHCP over the ad-hoc network to the notebook.

It is also worth noting that my notebook also displays wmaster0 in addition to wlan0. And also that the Wi-Fi card on my notebook is wlan0, while on my desktop it is wlan1 (and there is no wlan0 at the desktop). This is nothing serious, and is probably related to different network drivers.

How about encryption?

AFAIK, ad-hoc network wasn't meant to have support for encryption (but I can be wrong). Thus, I feel that ad-hoc plus encryption will give me much more problems than solutions.

The encryption is going to wait until my desktop is configured as a full access point.

How to manually set up the network?

Hey, I love to know how to do things and to understand how things work. I love to know how to manually set up the network, so I can manually do it on whatever distro I get my hands on. But... I gave up on understanding iwconfig.

I couldn't set up manually the network using iwconfig. And, what's more, whenever I try to manually use iwconfig in addition to gentoo scripts, things just get messed up. Many times I need to reload the network driver in order to have the network interface in a clean and sane state.

So, probably gentoo scripts run a few more commands or set up a few more parameters with iwconfig. A few more than I know about. Probably the network drivers are also a bit picky about the parameters. Then, unfortunately, I've given up on understanding iwconfig and manually using it.

Reloading network drivers?

C'mon, we all know that network drivers are a bit buggy, and sometimes the drivers don't want to set the network to the state that we are telling them to set. For instance, setting the network back from ad-hoc mode is painful (or impossible?). The same applies for setting back the network to a sane state after using a software like kismet.

These times I just feel that the network drivers are stubborn, or just buggy. Instead of blaming the developers (after all, their job is not an easy one, and Wi-Fi cards are much more complex than ethernet wired cards), I just unload the kernel module and reload it.

modprobe -r iwl3945 ; sleep 4 ; modprobe iwl3945
Probably the 4-second sleep is not needed, but won't hurt.

That's all folks!

I think I've finally documented everything about my Wi-Fi network. Ok, after one month of delay, but at least it is documented.

My Wi-Fi on Linux - The Empire Strikes BackMy Wi-Fi on... Windows???

Comments

qlue 21. August 2008, 02:43

:up:

How to use Quote function:

  1. Select some text
  2. Click on the Quote link

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

If you can't read the words, press the small reload icon.


Smilies

December 2009
S M T W T F S
November 2009January 2010
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31