LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Wireless Networking (https://www.linuxquestions.org/questions/linux-wireless-networking-41/)
-   -   Reconnect to wireless network (https://www.linuxquestions.org/questions/linux-wireless-networking-41/reconnect-to-wireless-network-386754/)

leupi 11-26-2005 02:34 PM

Reconnect to wireless network
 
I have a wireless network at my house and on occasion I have to turn off the wireless access point. When I turn it back on how do I reconnect the laptop to the access point? I have FC4 on the laptop and I can't seem to find any kind of wireless manager and it does not seem to log back on by itself. Right now I reboot the laptop but I'm sure that that is a bit of an extreme measure...

The access point is not WEP or WPA protected, all I have is MAC filtering but as I am pretty isolated from other houses that really is not an issue for me.

Thanks.

Todd

david_ross 11-26-2005 03:25 PM

Moved: This thread is more suitable in Wireless Networking and has been moved accordingly to help your thread/question get the exposure it deserves.

You should be able to run:
iwconfig DEV essid YOURESSID

Just change DEV for your ethernet device and YOURESSID for your access point essid.

rtozer 12-10-2005 07:50 AM

Hi

Was this issue ever resolved?
I have exactly the same problem.
Everything works perfectly except the link gets dropped occasionally. And then it doesn't reconnect.

Yes, typing iwconfig DEV essid YOURESSID re-establishes the connection. But that is just insane. Why doesn't it automatically attempt to reconnect when the link is lost? And continue to try until it manages to reconnect...

Google turned up several threads around the net with this issue but no one ever seems to be able to resolve it. The closest I've seen to a solution involved running NetworkManager which I tried. Not a healthy program that one. I couldn't get it to do anything other than break my system.

Surely there is a simple way to make a wireless connection automatically reconnect to the same access point if the link gets dropped.

tskears 12-11-2005 11:51 PM

Can't you re-establish the connection using KInternet?

rtozer 12-12-2005 07:48 AM

Hi
Thanks for the response.

What is KInternet? I don't seem to have any such app.
I am running fedora core 4. All the latest packages.

There is nothing wrong with my internet connection though. Jut the wifi link to my router.

My XP machine in the same room almost never drops the link and of course reconnects immediately if it does. Windows reads 4/5 bars and linux reads 100/100 link quality and the signal to noise ratio looks fine. Yet the linux machine gets dropped quite regularly. It survived all last night but has lost the link 3 times in the last hour. And since that machine is a web server this is not a good thing.

The link being dropped is not the issue I want to resolve here (though I will be looking into that too). I just want to know how to get linux to re-establish the link automatically if it gets dropped.

Should it do that automatically? Is something broken here that its not? Or does it not reconnect and no one knows why or how to fix it?

I did a yum update the other day (from the livna repository). It downloaded 1.3 gig so a major update took place. I downloaded the new matching 16k stack kernal from linuxant and recompiled ndiswrapper on that. My connection works fine. I just have to manually reconnect it if the link dies. Did the update break something?

When the link gets dropped (ethtools wlan0 shows Link detected:no) iwconfig reports all the correct info except the essid is changed from my essid to "off/any" and the AP MAC address is all 0s. Simply setting the essid to my essid re-establishes the connection to the AP. Is this the cause of the problem. It works fine at boot time so is in the correct config file ifcfg-wlan0 in network-scripts. Is there somewhere I have to tell it no to switch to off/any when the link is lost?

rtozer 12-13-2005 12:55 PM

Was that post too long? or can no one shed any light on this?

How do I get linux to automatically re-establish a wireless connection to my AP if the link gets dropped?

rtozer 12-15-2005 02:35 AM

Update:
I have this issue back to front.
The link going down is not the cause of the loss of the AP and ESSID values.
I broke the link manually to test and it reconnected fine.
So it seems that the system is randomly resetting the ESSID value to "off/any" and so dropping the link.

quackyo 01-01-2006 04:04 PM

I have the exact same problem - I've sat up a link between a WLAN and a wired network, using FC4 to route between this WLAN and the wired network.

a reboot (and surely a iwconfig essid ID) fixes the connection.

rtozer 01-01-2006 04:52 PM

Indeed iwconfig wlan0 essid ID re-establishes the connection. As would a reboot. But it happens often. Several times a day at least. And sometimes it gets into it really bad and won't stay connected for more than a few seconds before dropping it again. I created a script which I run with cron every 5 mins, it checks the connection and re-establishes it if its down. But this setup is just FAR too unstable to be of any practical use. Especially on a web server. I'm going to have to either find a card with native drivers or switch to a wired lan. Or perhaps I can take it up with the authors of ndiswrapper. I rebuilt ndiswrapper with debug=6 and have a few days of debug messages now. Unfortunately all it shows is something along the lines of "setting link=0". There is no error or activity, the driver just decides its no longer connected.

rtozer 01-01-2006 04:59 PM

excuse the double post, but here is some more info:

Card: Mentor WLG-PCI/II (802.11b/g)
Chipset: Ethernet controller: Marvell Technology Group Ltd. 88w8335 [Libertas] 802.11b/g Wireless (rev 03)
pciid: 11ab:1faa (rev 03)
Driver: mrv8335 (http://www.marvell.com/drivers/drive...?dId=122&pId=3)

I tried ndiswrapper 1.7, it was much worse than 1.5 so reverted to 1.5. And the system froze the other day on the latest kernel (2.6.14-1.1653_FC4.stk16). So for now I've dropped back to the most stable combination of ndiswrapper (1.5) and FC4 kernel (2.6.14-1.1644_FC4.stk16). Note these are the 16k stack versions of the FC4 kernels from Linuxant, the default 4k stack versions don't appear to be any less stable but ndiswrapper warns that the kernel only has a 4k stack and recommends recompiling with 16k.

The system is fairly stable now and seldom crashes, but the wireless link is hopeless.

otoomet 01-05-2006 11:18 AM

How looks your /etc/network/interfaces configuration? Have you specified essid, wep key etc.?

ifplugd is a smart daemon which is able to automatically re-connect. You should config the network in /etc/network/interfaces and ifplugd should do the job. It works fine on my debian box, haven't tried with wireless though.

there are several specific tools for wireless, e.g. waproamd.

Best,
Ott

rtozer 01-05-2006 03:50 PM

Hi otoomet
Thanks for the response.
My essid, WEP key etc are all configured in the correct files. It connects correctly when the machine boots up. If the router is reset the connection is re-established afterwards. It is some fault of the driver. The essid gets reset to "off/any" randomly.

otoomet 01-06-2006 01:32 AM

Yeah. Drivers are a problem.

You may still try ifplugd. If it can reconnect in seconds, perhaps it will do for you.

Best,
Ott

DougD 02-16-2014 12:34 PM

test for connection and reconnect wifi automatically
 
I realize this is an old thread that was moved but when I do a search this is the thread that shows up so I wanted to post the answer here.

I found the following script at sirlagz.net/2013/01/10/script-wifi-checker-script/

just create a new file
vi /root/checkwanup
#!/bin/bash

wlan=`/sbin/ifconfig wlan0 | grep inet\ addr | wc -l`
if [ $wlan -eq 0 ]; then
/sbin/ifdown wlan0 && /sbin/ifup wlan0
else
echo interface is up
fi

then chmod 555 /root/checkwanup
and add it to your crontab
crontab -e
*/15 * * * * /bin/bash /root/checkwanup


All times are GMT -5. The time now is 12:54 AM.