1

I do have a small pc(router_office) that runs debian wheezy (7) and it gets internet from wlan0 and acts as router for eth0 (NAT). Everything works fine.
My setup is pretty simple in /etc/network/interfaces:

auto wlan0
iface wlan0 inet static
    address 192.168.2.49
    netmask 255.255.255.0
    broadcast 192.168.2.255
gateway 192.168.2.1
    wpa-ssid "ATUX_wifi"
    wpa-psk "passw0rd4!"
dns-nameservers 8.8.8.8

auto eth0
    iface eth0 inet static
    address 192.168.1.10
    netmask 255.255.255.0
    dns-nameservers 8.8.8.8

I have an second wifi that i could get connected to, which has SSID:be_sec_office with passwd:passwfoo

While in my laptop debian 7 with lxde in the connection manager if one wifi fails, then it connects automatically to the next one. How can I do that in my small pc(router_office), please?

  • Please tell me that you didn't post your real WiFi passwd! – McSinyx Jul 20 '15 at 13:33
  • 1
    no it is not real ssids/passwds. just for the sake of example. – john Jul 21 '15 at 17:28
1

You have to switch from Managed mode to Roaming mode. It consist of defining your WiFi networks in /etc/wpa_supplicant/wpa_supplicant.conf and using logical interfaces in /etc/network/interfaces. To adapt the example from /usr/share/doc/wpasupplicant/README.Debian.gz (which is a good read), write something like

network={
    ssid="ATUX_wifi"
    psk="passw0rd4!"
    id_str="ATUX"
}
network={
    ssid="be_sec_office"
    psk="passwfoo"
    id_str="sec"
}

into /etc/network/interfaces and

auto wlan0
iface wlan0 inet manual
    wpa-driver wext
    wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

iface ATUX inet static
    address 192.168.2.49
    netmask 255.255.255.0
    broadcast 192.168.2.255
    gateway 192.168.2.1
    dns-nameservers 8.8.8.8

iface sec inet static
    address ...
    ...

into /etc/network/interfaces (besides the current lo and eth0 definition).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.