16 September 2008

Oldschool wireless

There's a really good guide to setting up WiFi without using NetworkManager at http://ubuntuforums.org/showthread.php?t=202834.

Why would you want to do this? Because when you do, the wireless LAN connection comes up automatically when you boot the machine. This is a really good idea if you are running any servers (e.g., the outrageously fun MPD). Of course it's a really bad idea to run a server off a wireless connection whether it comes up automatically or not, but sometimes you just can't snake cables where you want your machine to be. And if you're not running any servers, it spares you the bother of having to type in connection authorization at login. If you do a lot of roaming, then giving up NetworkManager (or the similar netapplet) may not be such a great idea; but if you don't, this approach may save you from some bother.

The only things I would add to what is posted in the Ubuntu forum are:
  1. You can include more that one interface in the /etc/network/interfaces file.
  2. If you use a network interface card that is removable (PCMCIA, USB, etc.) you may get better results if you specify it as allow-hotplug rather than auto.
  3. If you do specify an interface as allow-hotplug rather than auto, issuing the
    sudo /etc/init.d/networking restart
    command won't bring up the interface(s). To do that you will need to issue
    ifup < the_name_of_the_interface >
My main SkinnyDebbie test machine has one PCMCIA slot and no built-in networking. I tend to swap out a wireless and a wired Ethernet card. My /etc/network/interfaces file looks like this:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
#auto eth0
iface eth0 inet dhcp

allow-hotplug ath0
#auto ath0
iface ath0 inet dhcp
wpa-driver madwifi
wpa-ssid ufart
wpa-ap-scan 1
wpa-proto WPA
wpa-pairwise TKIP
wpa-group TKIP
wpa-key-mgmt WPA-PSK
wpa-psk <>
Of course, your details will differ.

No comments: