[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debian 5 server - auto-reconnect to wireless networks?



After some time with a newer version of network manager my experience is
the same as Klistvud's. Although the automatically reconnecting
behaviour seems to be enabled, it doesn't always work. Perhaps bugs in
the wireless card driver, or in network manager, or perhaps it's just
cause as Mirko says network manager is not meant for running on a server
and keeping the internet connection up all the time.

So I read this:
http://www.debian.org/doc/manuals/debian-reference/ch05.en.html
which is quite badly written but it did give me the basic idea about
ifupdown and /etc/network/interfaces. Then I read the README.modes that
Mirko pointed out and that filled in the details. I unchecked "Enable
wireless" in network manager and then added this to
/etc/network/interfaces:

auto eth0
iface eth0 inet dhcp
    wpa-ssid "My ESSID"
    wpa-psk my_hexadecimal_key

I inspected the output of the ifconfig command to figure out that my
wireless card is called eth0.  I used the wpa_passphrase command to
generate the hexadecimal code for the WPA2 shared secret. This works,
now sudo ifdown eth0 will disconnect and sudo ifup eth0 will reconnect to
the internet, and it connects to the internet when I reboot the laptop
also (I think the auto eth0 line does that).

There was nothing in any of those docs about reconnecting to the
wireless network if the network goes away for a time, or about keeping
the connection alive. But testing seems to reveal that it magically
takes care of this. I tried turning the modem off and then on again
quickly to simulate someone "restarting" it, this quick on and off
seemed to trip up network manager often, but with this setup the laptop
reconnects. I also tried turning the modem off for a longer period and
when I turned it back on the laptop reconnected again also.

This was much simpler than I expected after first looking at the docs
for it. If I did want to switch back to network manager temporarily it
should be as simple as checking "Enable wireless" in network manager
again, maybe commenting out the lines I added to /etc/network/interfaces
first. It's only been one day so far, but looks promising.

I'm no expert but I feel like I finally have a foot in the door with
debian network configuration.

Thanks for the help

On Mon, Feb 22, 2010 at 12:55:24PM +0100, Mirko Parthey wrote:
> On Sun, Feb 21, 2010 at 04:46:51PM +0000, chombee wrote:
> > I'm wondering how to get my Debian server to automatically reconnect to
> > my wireless network. The server is an OLPC XO-1 running Debian 5 Stable
> > via the DebXO distribution. It does not have a wired ethernet port, it
> > connects to the internet through my home wireless network. The wireless
> > router occasionally gets restarted, sometimes when I'm not home, and
> > this requires me to physically go to the laptop to manually reconnect
> > either by operating the network manager applet with the mouse or by
> > running a script that uses ifconfig, iwconfig and dhclient.
> 
> The network manager package description says it "is not intended for
> usage on servers".  If you want an interface to be permanently up,
> without even logging in, you should set it up in
> /etc/network/interfaces.
> 
> Check out /usr/share/doc/wpasupplicant/README.modes.gz from the
> wpasupplicant package. Your case should be covered by section 2:
> "Mode #1: Managed Mode".
> 
> Mirko
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org 
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Archive: http://lists.debian.org/20100222115524.GA8471@titus.informatik.tu-chemnitz.de
> 

On Thu, Feb 25, 2010 at 10:36:45AM +0100, Klistvud wrote:
> Dne, 22. 02. 2010 12:55:24 je Mirko Parthey napisal(a):
>>
>> The network manager package description says it "is not intended for
>> usage on servers".  If you want an interface to be permanently up,
>> without even logging in, you should set it up in
>> /etc/network/interfaces.
>
> I'll second that. I have a similar situation (no wired eth port) and went 
> for the fixed-IP solution, disabling DHCP and network manager for the 
> wireless interface. That said, however, I also have a laptop with network 
> manager and it *does* re-connect to the wireless network every time my 
> router gets reset. I think this may depend on the default wireless 
> network(s) you configure through right-clicking on the network applet and 
> selecting "Edit wireless networks". IIRC, network manager is designed to 
> automatically connect (and re-connect) to any network you have configured 
> there.
> That said, *sometimes* my network manager simply fails to reconnect; I  
> always thought the network driver I'm using (the proprietary Broadcom  
> wl.ko) was the culprit.
>
> -- 
> Regards,
>
> Klistvud
> Certifiable Loonix User #481801
> http://bufferoverflow.tiddlyspot.com
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Archive: http://lists.debian.org/1267090605.2332.2@compax
>



Reply to: