Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a WiFi module that is registered with a WiFi network. There are a few other WiFi networks in the area. The computer, however, does not know which WiFi network it can connect to.

So the computer has try to see which WiFi it can access the internet with. If it can't get on (and say access with one WiFi, it should try the next.

Is there a way to automatically do this with debian or a program like WiCD?

share|improve this question
up vote 1 down vote accepted

You can do this in BASH. Simply check your connection every minute or ping response(if its too high). Scan networks, and switch it.

for scanning you can use:
$ iwlist wlan0 scan

for connecting you can use

killall -9 dhclient
ifconfig wlan0 down
ifconfig wlan0 up
iwconfig wlan0 channel CHAN
iwconfig wlan0 essid ESSID
ifconfig wlan0 up
dhclient wlan0

you can easily bind(combine) the scanning script to(with) the connecting one using grep/awk/cut which are very helpful tools.

If you are using Ubuntu(Spying!!!) turn off network-manager service by:
temp solution till reboot
$ /etc/init.d/network-manager stop
permament solution till chmod +x (when you want networkmanager back)
$ chmod -x /etc/init.d/network-manager

on Fedora(You are safe for now!) the service is called NetworkManager:
temp sol:
$ service NetworkManager stop
perm sol:
$ service NetworkManager disable

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .