NihonLinks News from James Miller

Techlaw Insights in Japanese and English from James Miller

I installed my first version of Linux close to 20 years ago (cross-compiled minix on an Amiga 500) and have been using WiFi under Linux for more than 10 years, and I have to say things have finally come around.  If you can’t get your WiFi card in master mode to serve as an access point using post 2.6 and 3.0 linux kernels you’re probably doing it wrong.. here’s the experience of a gray’ing hair administrator’s experience getting master mode working on a home LAN to serve as the family access point, upgrading to Oneiric Ubuntu 11.10 server addition.

I recently decided to finally upgrade my “junkbox-based” (you can’t buy this brand of PC at BestBuy but you can get it for free on craigslist)  Internet gateway/LAN server from the 2 versions old Debian/Ubuntu distribution I had to the new stable release.  At 11:30pm I was overcome with irrational exuberance and installed over the working partition.  I ended up at 4am giving up on getting my Wifi card working in “master mode” to serve as the house Wifi access point.  Thanks to my friend Warren Turkal and former googler for nudging me out of the dark ages of and forcing me to use the new standard networking tools.. that eventually solved my problems.  I’m going to pass along a few things to anyone else who still thinks that shell scripting your routes and ifconfigs is the “right way” to do things on on the Linux dominant world of today..

First a little background.  I cut my Unix administration teeth in the San Francisco Bay Area as a Mountain View startup where my first real exposure to production machines was dominated by SunOS/Solaris, AIX, and HPUX.  Ifconfig, route, tcpdump and the standard toolset define my view of the world, and all the client side supplicant, “network-manager” and other client configuration tools designed to make things “just work” never quite work for me and get in the way of my classic world view of how to configure my networking.  When even my googler friend (who I assume is a pretty good bar for nerd levels of normality) says my uses are fringe, I suppose I have to grant I’m part of the 1% when it comes to networking users.  Bonding multiple residential broadband accounts together with hacky ebtable/iptable forwarding scripts may not be necessary for my teenager to browse blackboard but I do like to stay abreast of new QOS and other network managment developments.  Sadly, the time has come when ifconfig, iwconfig and route simply aren’t sufficient to administrate modern Linux boxes and I have to join the 99%.

Under the old world view, configuring wireless cards was a matter of configuring it to “master” or “AP” transmission mode to make the card handle frames correctly and function as an access point.  Only a limited set of drivers for certain cards supported master/AP mode like the the Atheros AR5212/5213 based Trendnet TEW-443PI card I have.  I had tried several variety of Ralink and other cards without success.  Some of the drivers used special commands to manipulate the cards, like the Madwifi packages “wlanconfig” command, but once it was in master you didn’t need much else to get layer 3 networking going, if you weren’t using security.  Once the card was loaded correctly you could give the wireless device an appropriate address, setup your firewall/forwarding rules using IPTables or other tool, fire up a DHCP server and the AP would be working..  Ok, so it may not have been that easy afterall but my classic ifconfig/route view of the world wasn’t fundamentally challenged.

Today, you can’t put supported cards in master mode using iwconfig, even if the card supports master mode.  Hostapd must be configured to get things working, as least for the new (new as far as I’m concerned..) wireless drivers incorporated in the post 2.6 and 3.0 Linux kernels.

http://en.wikipedia.org/wiki/Hostapd

Having spent more than 8 hours (ah, what I could have billed this project for back in the day but let’s not mention what I should be charging myself for this adventure…) fiddling with it I took the advice of my friend and installed hostapd and magically the card went to master mode and I was able to setup my layer 3 networking.

I had viewed hostapd as a authentication daemon and hadn’t even been using dhcp for the small controlled network I was using, and viewed it as unnecessary.  Now, if you want to get a Wifi AP working you *must* install and configure hostapd to get the card in master mode.  After discussions with my friend I understand that because of the complexity of implementing WPA and other security extensions common today (required by most Wifi hostspots) it was never reasonable to put that functionality in iwconfig or the other tools.  Thus one takeway is that Linux Wifi driver networking is fundamentally infused today with security at the layer 2 configuration level.

I searched high and wide for “master mode ath5k ubuntu 11.10 oneiric” and found nothing.  So in the interest of saving the next guy 8 hours of wifi’less wheel spinning.. listen to the young wippersnappers when they tell you to follow the instructions installing all these new fangled tools.. because as it turns out, Today, Linux wireless networking does actually “work out of box…”

On the bonding and multiple default routes discussion, I’d recommend reading Darien Kindlund’s Blog post on the subject at, http://kindlund.wordpress.com/2007/11/19/configuring-multiple-default-routes-in-linux/.  Great read, and may keep you in the 1% of fringe Internet network engineering.. :)