Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Alternative to Network-Manager + MadWifi

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Post Reply
Message
Author
hkoster1
Posts: 1264
Joined: 2006-12-18 10:10

Alternative to Network-Manager + MadWifi

#1 Post by hkoster1 »

Running network-manager in combination with the wireless MadWifi drivers has long been a problem, see e.g. Debian BTS 387851 or MadWifi ticket 462. The problem, in short, is that connections take a long time to get established, if they get established at all. Yet, there is no problem bringing the ath0 interface up (or shutting it down) manually, using either iwconfig or ifup/down, except that this procedure is a PITA to carry out at every boot.

But there is a convenient alternative... wpa_supplicant in roaming mode. This feature is virtually absent from the various Debian (and Debian-related) forums and wikis, perhaps because the name of the wpa_supplicant package suggests that it can only be used for handling WPA wireless encryption. Truth is, however, that it can handle automatic connections to a variety of encrypted and open networks as well as network-manager does... and better when using the MadWifi drivers!

I'll show you my typical setup: a WPA-PSK encrypted connection at home: a WEP encrypted connection at some friend's place; open HotSpot connections to a named provider on the road; and arbitrary connections to whatever open wireless network is present. More complicated setups, including secured access to wired networks, can be gleaned from the very extensive documentation and man-pages (another possible barrier to use by ordinary users) -- here, I'm giving EduRoam as an example.

First, edit /etc/network/interfaces by adding the stanzas:

Code: Select all

auto ath0
iface ath0 inet manual
   wpa-driver madwifi
   wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
which will bring up the physical ath0 interface on boot through the logical interface default.

Edit: Indications are that the generic Linux wext driver has now (March 2008) developed sufficiently for it to be used in place of the madwifi driver shown above. Try it if the latter doesn't, for any reason, work out.

Next, make or edit /etc/wpa_supplicant/wpa_supplicant.conf, where I've given some typical network entries that serve me well:

Code: Select all

ctrl_interface=/var/run/wpa_supplicant
ap_scan=1
network={
        ssid="MyWirelessHomeLAN"
        key_mgmt=WPA-PSK
        psk="MySooperSecretPassPhrase"
}
network={
        ssid="MyFriendsWirelessLAN"
        key_mgmt=NONE
        wep_key0="HerPasswd"
        wep_tx_idx=0
}
network={
        ssid="OpenHotSpotProvider"
        key_mgmt=NONE
}
network={
        scan_ssid=1
        key_mgmt=NONE
}
network={
        ssid="eduroam"
        scan_ssid=1
        key_mgmt=IEEE8021X
        eap=TTLS
        anonymous_identity="anonymous@your.school"
        identity="yourID@your.school"
        password="yourPassword"
        phase2="auth=PAP"
        ca_cert="/path/to/certificates/eduroam.der"
        priority=2
}
One of these networks is brought up automatically, whichever present. If more than one is present, the most secure one will be brought up and, if equally secure, the one with the strongest signal. The EduRoam example has elements that are set by the educational facility involved, ask their IT people for further details.

The ath0 interface can also be brought up manually (with root privileges) with the ifup ath0 command. Note that wpa_supplicant takes over the control of ifupdown when configured this way, so manually stopping the wireless interface must be done with the command wpa_action ath0 stop. Note also that the interface need not be stopped when making some changes to the above noted stanzas in either file, like adding another network -- just use the wpa_action ath0 reload command to commit those changes.

This all works so well, I guess I'll never use network-manager again.:wink:
Last edited by hkoster1 on 2009-09-10 07:06, edited 8 times in total.

User avatar
e1even1
Posts: 267
Joined: 2007-03-09 19:18

#2 Post by e1even1 »

thank you for this. you just saved me some trouble.

hkoster1
Posts: 1264
Joined: 2006-12-18 10:10

#3 Post by hkoster1 »

Good to hear that!

I should add that wpa_supplicant in roaming mode will also work well with other wireless drivers, for chips other than Atheros, and even with the ndiswrapper driver for wireless chips not supported by the Linux kernel. Of course, there isn't much incentive to switch if network-manager already does the job, but it's a thought for those who like to experiment. 8)

User avatar
Ghstryder
Posts: 8
Joined: 2007-05-16 02:37
Location: Detroit, Michigan

#4 Post by Ghstryder »

Thanks! What a timely post indeed. I have a wpa wrestling match with my laptop scheduled for this weekend.

LB

linuxnoob
Posts: 4
Joined: 2007-07-21 07:02

#5 Post by linuxnoob »

thanks a lot hkoster1, I still have the madwifi and network manager installed, should I delete them first and then follow your instruction?

hkoster1
Posts: 1264
Joined: 2006-12-18 10:10

#6 Post by hkoster1 »

The "auto ath0" line in /etc/network/interfaces means that the ath0 interface will not be managed by network-manager. So, no, you don't need to remove network-manager first for my recipe to work. However, since wpa_supplicant works so well this way, I have now removed network-manager on my own laptop. :)

User avatar
nasty canasta
Posts: 24
Joined: 2007-03-05 00:18
Location: Melbourne

#7 Post by nasty canasta »

hkoster, which version of the wpasupplicant package are you running?

I had no problems whatsoever with the 0.5.5-2 version in Etch. However, on upgrading to Lenny (about 2 weeks ago) I found that my config no longer worked. A cursory google revealed that others had problems and it seemed to be that the current testing release 0.6.0-1 does/did not support the keyword "NONE" (Sorry can't seem to find those links right now).

Rather than fiddle around, I downgraded the package as a temporary measure till I get some time to have a good look. Has anyone else had any issues with the current testing package?

Cheers,

Dave
Thinkpad X40, Debian Lenny/Sid

hkoster1
Posts: 1264
Joined: 2006-12-18 10:10

#8 Post by hkoster1 »

Mmm... I'm running wpa_supplicant 0.6.0-2 from Sid, but have been running earlier versions as well without problems. Have you checked the man-page for wpa_supplicant.conf?

User avatar
nasty canasta
Posts: 24
Joined: 2007-03-05 00:18
Location: Melbourne

#9 Post by nasty canasta »

hkoster1 wrote:Have you checked the man-page for wpa_supplicant.conf?
Yes, Thanks ;)

Here is the initial bug report I was referencing:
http://www.mail-archive.com/debian-bugs ... 63915.html

It seems rather than having issues with
  • key_mgmt=NONE
as I originally posted, the issue seems to arise when trying to connect to a network where the ssid is unspecified. I've just upgraded and fooled around with /etc/wpa_supplicant/wpa_supplicant.conf and my testing seems to back this up. In all other respects wpasupplicant 0.6.0-1 seems to work fine.

NB. Both bug reports in the above link come from laptops running ipw cards, so perhaps its a problem with the ipw* cards/drivers. I am running ipw2200BG

For completeness, here is my /etc/network/interfaces:

Code: Select all

#eth0 wired ethernet
allow-hotplug eth0
iface eth0 inet dhcp

#eth1 primary wireless interface
allow-hotplug eth1
iface eth1 inet manual
wpa-driver wext
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

#work
iface work inet dhcp

#home
iface home inet dhcp

#named
#iface named inet dhcp

#free
iface default inet dhcp
and my /etc/wpa_supplicant/wpa_supplicant.conf:

Code: Select all

# default ctrl_interface path

ctrl_interface=/var/run/wpa_supplicant

#ap_scan=1


#work
network={
        ssid="myWork"
        id_str="work"
        psk="workWPAString"
        priority=4
}

#home
network={
        ssid="MyHome"
        id_str="home"
        key_mgmt=NONE
        priority=5
}


#named
#network={
#       ssid="undef"
#       id_str="named"
#       key_mgmt=NONE
#       priority=3
#}


#open
network={
        ssid=""
        key_mgmt=NONE
        priority=2
}
Any feedback would be most welcome :-)

Cheers,

Dave
Thinkpad X40, Debian Lenny/Sid

hkoster1
Posts: 1264
Joined: 2006-12-18 10:10

#10 Post by hkoster1 »

You may well be right about "empty" ssid strings... haven't had a chance to try that out myself yet with version 0.6.0-2.

About your configuration: you could just use the single default logical interface ("default") in /etc/network/interfaces, since all your wireless networks use DHCP. In that case, the id_str and priority lines in the .conf file aren't needed either, unless of course there are locations where more than one of your named networks is available. But these are just simplifications that wouldn't affect operability -- which seems fine to me.

There's something strange about the default Linux wext wpa-driver, though. I use a Netgear WG111v2 USB wireless dongle on another machine, with an RTL8187 chipset. The wext driver will not work with that device, whereas the ipw driver does... even though the ipw driver appears to call on the wext driver itself. You might try the ipw driver and see if that improves things.

hkoster1
Posts: 1264
Joined: 2006-12-18 10:10

#11 Post by hkoster1 »

It appears that the generic Linux wext wireless driver now also works, or is close to working, for Atheros chipsets. I've been trying the Alpha 6 version of Ubuntu 8.04 on my original CD MacBook (with AR5424/2424 Atheros chipset) for which Network-Manager could not be made to work. The wpa_supplicant roaming mode of my OP didn't work either when using the madwifi driver, but it did with the wext driver. So, there's hope for those of you who've had problems making Atheros wireless work with the 2.6.24 kernel in Sid.
Real Debian users don't do chat...

User avatar
birdywa
Posts: 120
Joined: 2007-12-08 22:15

Re: Alternative to Network-Manager + MadWifi

#12 Post by birdywa »

Im much more partial to wicd.

milomak
Posts: 2158
Joined: 2009-06-09 22:20
Been thanked: 1 time

Re: Alternative to Network-Manager + MadWifi

#13 Post by milomak »

birdywa wrote:Im much more partial to wicd.
it certainly does the business
Desktop: A320M-A PRO MAX, AMD Ryzen 5 3600, GALAX GeForce RTX™ 2060 Super EX (1-Click OC) - Sid, Win10, Arch Linux, Gentoo, Solus
Laptop: hp 250 G8 i3 11th Gen - Sid
Kodi: AMD Athlon 5150 APU w/Radeon HD 8400 - Sid

jessyj
Posts: 1
Joined: 2010-11-25 07:28

Re: Alternative to Network-Manager + MadWifi

#14 Post by jessyj »

@ other posters. Please keep this post OT! If you are in a position to suggest valid comments or additional items regarding the problems resulting from inappropriate installations of alternative distros, please comment.

Post Reply