S
S
Spym2012-05-10 22:54:57
linux
Spym, 2012-05-10 22:54:57

How to organize automatic connection to any known wireless network?

There is an embedded computer running Ubuntu Server 11.10, and several geographically dispersed wireless networks between which the computer can physically move.
It is necessary to automatically connect to any known Wi-Fi network as soon as it becomes visible (this behavior is implemented by graphical network managers, such as Network Manager).

For one network, the task is trivially solved (/etc/network/interfaces), but are there ready-made solutions for my case? I don't want to reinvent the wheel.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Ramzeska, 2012-05-11
@Spym

Write a script to find and connect to networks in /etc/network/if-post-down.d
Something like this:

#!/bin/sh

while true
do
  iwlist eth1 scan > /tmp/wiscan.txt
  if `cat /tmp/wiscan.txt | grep -c SSID1` = 1 then
  do
    iwconfig eth0 ssid SSID1
    exit
  done

  if `cat /tmp/wiscan.txt | grep -c SSID2` = 1 then
  do
    iwconfig eth0 ssid SSID2
    exit
  done

  sleep 3
done

J
JIesnik, 2012-05-11
@JIesnik

The important thing is that Network Manager itself is not a graphical tool.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question