Two 〈Foo〉s Walk into a 〈Bar〉: Featuring the Highest Angle Bracket–to–Word Ratio Among Site Titles

wpa_supplicant for Linux Networking at Pitt

The University of Pittsburgh changed its network for the 2004–2005 school year, switching from PPPoE to IEEE 802.1x. Pitt's implementation seems a bit unreliable, even through Windows XP and the AEGIS client they provide. Here I've put up some information to help other people who run Linux at Pitt to get online. Most of the information here, much of it courtesy of the Pitt Geeks, describes wpa_supplicant, as Xsupplicant, the program I previously used, is deprecated in Gentoo and is generally slow and buggy. If wpa_supplicant doesn't work, you might try Xsupplicant or the Linux version of the AEGIS client. I have not personally used the AEGIS client, and I've already mentioned by problems with Xsupplicant, but I have kept that information around at the bottom of this page for anyone who is interested.

wpa_supplicant Information from Pitt Geeks

The Pitt Geeks have provided two scripts wpa_supplicant Configuration Scripts, one of which works with Ubuntu and the other of which works for different distributions. Their wiki also includes detailed intructions for the Ubuntu setup. At this point, the Pitt Geeks website is the main place to read about wpa_supplicant.

wpa_supplicant and beconnected Overlay for Gentoo Users

If you're using Gentoo and don't mind dealing with Portage overlays, you can download a Gentoo ebuild and throw it in your overlay, probably under net-misc. Then emerge beconnected and follow the instructions.

Manual wpa_supplicant Setup and Gentoo

With the Pitt Geeks handling most of the wpa_supplicant instructions, I've decided to supply a little Gentoo‐specific information here.

Installing the Client

First, the client. You'll need to install wpa_supplicant. Gentoo users should be able to emerge wpa_supplicant. Other distributions have their own methods, of course. Should you need to install it manually, it's not difficult, presuming basic experience with Linux. There's a README file included in the download for those less familiar.

Configuration

Gentoo has the configuration in /etc/wpa_supplicant/wpa_supplicant.conf by default. Below is a link to the configuration file provided by Pitt Geeks. Save it to disk somewhere, open it, and change USERNAME to your own username and PASSWORD to your own password. These should be the only changes required, but be sure to make them. Then move the file to its proper location (you'll probably need to be root for this step).

Connecting

You are now theoretically ready to connect. You may do so manually, or, if you're a Gentoo user, you may attempt to modify /etc/conf.d/net as I describe below.

Gentoo /etc/conf.d/net Configuration (recommended)

/etc/conf.d/net contains configuration for all network interfaces on your machine. If you don't have any configuration there at the moment and you want to use eth0 to connect to ResNet (most likely), you can save the file below and, as root, move it to /etc/conf.d/net. You can then connect to the network as you normally would without wpa_supplicant by running /etc/init.d/net.eth0 start.

Connecting Manually

This will take multiple steps, and you must run the commands as root.

  1. Start wpa_supplicant. You'll need to pass in your network interface (probably eth0), the location of the configuration file, the type of network driver (wired network), and a flag to run the command in the background:
    /sbin/wpa_supplicant -ieth0 -c/etc/wpa_supplicant/wpa_supplicant.conf -Dwired -B
  2. Attempt to connect to the network. With Gentoo, I am able to make changes in /etc/conf.d/net and then run /etc/init.d/net.eth0 start to do this. I believe that among the commands ultimately being run are ifconfig, used to bring up the network card, and either dhcpcd or dhclient, a DHCP client daemon. For each of these commands, you want to pass in your network interface as a parameter. This makes the commands similar to:
    ifconfig eth0 up
    dhcpcd eth0 OR dhclient eth0

beconnected — Reconnect to the Network When Disconnected

This script has a simple job: It pings a network server every 15 seconds, and if the server doesn't respond (within two tries), it runs /etc/init.d/net.eth0 restart to reconnect. I've found it nice for when I get kicked off overnight, for example. This is a Perl script, and you may need to edit a couple lines, as described in the file itself. Note that you need both the beconnected script and the accompanying pingwait, and you'll probably want to put them in /usr/local/bin, which will require you to be root. You'll also have to make them executable.

init Script

Gentoo users who set up /etc/conf.d/net should be able to configure their network connection to start on boot by running rc-update add net.eth0 start. I am also supplying an init script for beconnected. You can download it, save it in /etc/init.d (root permissions required), and make it executable, and you can configure it to run at boot with rc-update add beconnected start. (Just make sure it knows where to find beconnected.)

Conclusion

Improvements, questions, problems, etc. welcome at the address listed. Thanks to everyone who has supplied information in the past.