Thursday, 25 October 2007

Automatically Connecting to Wireless Networks

The Linux world still has the capacity to leave me shaking my head in bewilderment...

One of the things that Vista does really well is managing wireless network connections. Vista will automatically connect to an available wireless network without you having to do anything. If you look at a standard install of Linux, even an install of a "cutting edge" distro like Fedora 7, you would never guess that Linux offers the same functionality.

I have literally spent months looking for an easy way to connect to wireless networks. I looked at utilities like wlassistant and netgo; neither of which turned out to be much good. I even wrote my own bash script using iwlist to scan for available networks and iwconfig to connect. (This worked, but was let down by DHCP problems with dhclient when switching networks.)

The solution was installed on Fedora all the time. The only problem was that it was not enabled, and - worse - not visible. The solution is NetworkManager.

NetworkManager will automatically connect to an available wireless network. But that's not all it does. NetworkManager actively monitors your network connections so that if you plug in a network cable it will disconnect the wireless connection and use the faster wired connection instead; remove the cable and NetworkManager reconnects to the wireless network on the fly. Very, very, cool.

So how do you get it to work? To start NetworkManager manually you can just type the following on the command line:

/usr/sbin/NetworkManager

However, once you are happy NetworkManager is working for you, you will want to have it start automatically:

/sbin/chkconfig --level 345 NetworkManager on
/sbin/chkconfig --level 345 NetworkManagerDispatcher on
/sbin/service NetworkManager start
/sbin/service NetworkManagerDispatcher

Why was it so hard to find? Why isn't the Linux world trumpeting its existence? It is very strange. Perhaps the answer goes back to the issue of what Linux is for. Being a commercial rival to Windows doesn't seem to be what Linux is for- which is fine. So what are Redhat and Novell and Ubuntu doing?

There is more information on NetworkManager here and here.

2 comments:

Wireless said...

Hello. This post is likeable, and your blog is very interesting, congratulations :-). I will add in my blogroll =). If possible gives a last there on my blog, it is about the Wireless, I hope you enjoy. The address is http://wireless-brasil.blogspot.com. A hug.

Gringo_Malo said...

Any chance you could post that bash script? I have a desktop running Fedora 8 that I'd like to use as a server. So I'd prefer that the desktop connect to my wireless network automatically when it boots. (My wife objects to Ethernet cables strung across the bedroom for some reason.) I can connect with NetworkManager, but it requires that somebody be logged on AND enter a second password before it connects. I've been struggling for the last five days or so to connect without NetworkManager.