Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
auto reconnect on wireless
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Tomsen
n00b
n00b


Joined: 26 Feb 2005
Posts: 63
Location: Denmark

PostPosted: Mon Feb 05, 2007 8:29 am    Post subject: auto reconnect on wireless Reply with quote

Hi

I've just changed our wired network with wireless in the entire house. I have no problem with connecting to the AP, but because i have a cheepass router that has to restart everytime I change in the NAT settings.
This results in my server loosing the connection to the AP and i have to connect a screen and keyboard to restart the wireless interface.
How do i make it recoonect by itself?
_________________
Don't ever argue with an idiot, he will bring you down to his level and beat you with exprience
Back to top
View user's profile Send private message
DavidJN
n00b
n00b


Joined: 20 Jan 2005
Posts: 23

PostPosted: Mon Feb 05, 2007 1:17 pm    Post subject: Reply with quote

Might an easier solution be to use SSH to restart it?
Back to top
View user's profile Send private message
Tomsen
n00b
n00b


Joined: 26 Feb 2005
Posts: 63
Location: Denmark

PostPosted: Tue Feb 06, 2007 9:24 am    Post subject: Reply with quote

I can't ssh to the machine, it has lost its network connection. That is why I have to connect a screen and keyboard
_________________
Don't ever argue with an idiot, he will bring you down to his level and beat you with exprience
Back to top
View user's profile Send private message
ManReal
n00b
n00b


Joined: 30 Jan 2007
Posts: 10

PostPosted: Tue Feb 06, 2007 2:12 pm    Post subject: Reply with quote

Can you not have a script running in the background on the server which pings google.com and if the ping fails then you reconnect the connection?
Back to top
View user's profile Send private message
Tomsen
n00b
n00b


Joined: 26 Feb 2005
Posts: 63
Location: Denmark

PostPosted: Fri Feb 09, 2007 8:22 pm    Post subject: Reply with quote

Well I could, but isn't it possible to make gentoo reconnect if it looses the connection?
_________________
Don't ever argue with an idiot, he will bring you down to his level and beat you with exprience
Back to top
View user's profile Send private message
qdii
Tux's lil' helper
Tux's lil' helper


Joined: 19 Sep 2009
Posts: 106
Location: Madrid

PostPosted: Thu Dec 17, 2009 8:27 am    Post subject: Reply with quote

Sorry to reopen that thread, but it corresponds to a problem I am having.
To keep my 2nd computer connected to a Wifi network, I've crafted that little script :
Quote:

#/bin/sh
if ping -q -c 1 www.google.com &> /dev/null
then
echo `date`: UP >/var/log/autoreconnect
else
ifconfig wlan0 down && sleep 5 && ifconfig wlan0 up
echo `date`: DOWN > /var/log/autoreconnect
fi

When I run it from a standard bash shell, it works fine.
bringing wlan0 down and up does - I imagine - reset it and DHCP finishes the work.
but when I schedule it to be executed every 3 minutes with vixie-cron, the connection remains down, even though /var/log/autoreconnect contains a line stating that it was DOWN a minute ago.

Any idea ?
Back to top
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Thu Dec 17, 2009 10:10 am    Post subject: Reply with quote

could you not just restart the net.wlan0 init script?
Back to top
View user's profile Send private message
Yamakuzure
Advocate
Advocate


Joined: 21 Jun 2006
Posts: 2305
Location: Adendorf, Germany

PostPosted: Thu Dec 17, 2009 10:49 am    Post subject: Reply with quote

Maybe you could give net-misc/wicd a try? It allows for running custom scripts before/after shutting down/starting up a connection. And on my laptop if I re-enable wireless via rf-kill switch, connects in an instant. (Quite useful for a laptop that keeps travelling and switching between different wired and wireless networks.)
_________________
Edited 220,176 times by Yamakuzure
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


Joined: 25 Apr 2005
Posts: 13047
Location: Ste-Foy,Canada

PostPosted: Thu Dec 17, 2009 12:59 pm    Post subject: Reply with quote

I use the auto-reconnect option inside WICD and it's working pretty good.
Back to top
View user's profile Send private message
qdii
Tux's lil' helper
Tux's lil' helper


Joined: 19 Sep 2009
Posts: 106
Location: Madrid

PostPosted: Fri Dec 18, 2009 12:35 am    Post subject: Reply with quote

cachorro : I've tried to use /etc/init.d/net.wlan0 restart, but it gets an error from something in /proc/.../carrier and won't reconnect the wifi until I stop and start the interface.

for what concerns WICD, I'll give it a try tomorrow :) thanks for the tip
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


Joined: 25 Apr 2005
Posts: 13047
Location: Ste-Foy,Canada

PostPosted: Fri Dec 18, 2009 3:06 am    Post subject: Reply with quote

No problem, and if you need help, just post :P
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum