LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Howto reconnect to W-LAN without restart (http://www.linuxquestions.org/questions/slackware-14/howto-reconnect-to-w-lan-without-restart-552538/)

ppr:kut 05-09-2007 06:50 AM

Howto reconnect to W-LAN without restart
 
Hi folks,

I have some problem regarding connection to wireless networks. I use commandline to enable a connection, and I get connected, but at times, when the signal is lost, I can't reconnect with the same command. I have to restart the whole system to reestablish a connection. The power button for my Wireless card does not work in Linux and the txpower-stuff doesn't work neither.
I would be really thankful for any suggestions in that way, as it is really annoying.
At last my script I use to connect:

Quote:

/sbin/iwconfig eth1 essid AP-FHE-ICS key ***************************
/etc/rc.d/rc.inet1 restart
BTW: Another problem I have regarding my wireless is it searches very long for an IP on boot (via DHCP), my lan-card on the other hand not (also configured with DHCP). Is there some way to fix that?
Thanks in advance!

BCarey 05-09-2007 10:36 AM

I have had this problem occasionally as well. Instead of rebooting, rmmod your driver and then modprobe it again. Also, not sure what kernel your using, but since I upped to 2.6.21 it connects a lot faster (I'm using bcm43xx).

Brian

onebuck 05-09-2007 10:48 AM

Quote:

Originally Posted by ppr:kut
Hi folks,

I have some problem regarding connection to wireless networks. I use commandline to enable a connection, and I get connected, but at times, when the signal is lost, I can't reconnect with the same command. I have to restart the whole system to reestablish a connection. The power button for my Wireless card does not work in Linux and the txpower-stuff doesn't work neither.
I would be really thankful for any suggestions in that way, as it is really annoying.
At last my script I use to connect:

Quote:

/sbin/iwconfig eth1 essid AP-FHE-ICS key ***************************
/etc/rc.d/rc.inet1 restart
BTW: Another problem I have regarding my wireless is it searches very long for an IP on boot (via DHCP), my lan-card on the other hand not (also configured with DHCP). Is there some way to fix that?
Thanks in advance!

Hi,

I would do a 'iwlist eth1 scan' for available AP. You will have to identify your AP in case there are other APs' in your area. The confirmation of the AP will assist you. Is this a personal AP? What about lease time?
The problem could be relative to the auto situation so
from 'man iwconfig' concerning the ap option;

Quote:

ap

Force the card to register to the Access Point given by the address, if it is possible. When the quality of the connection goes too low, the driver may revert back to automatic mode (the card selects the best Access Point in range). You may also use off to re-enable automatic mode without changing the current Access Point, or you may use any or auto to force the card to reassociate with the currently best Access Point.
Example :
iwconfig eth0 ap 00:60:1D:01:23:45
iwconfig eth0 ap any
iwconfig eth0 ap off
You could stop the eth0 and restart it.

Code:

#ifconfig eth0 down        #interface to be shut down
#ifconfig eth0 up          #interface activated
#/etc/rc.d/rc.inet1 restart #restart using /etc/rc.d/rc.inet1.conf

You do have your /etc/rc.d/rc.inet1.conf configured properly.

Quote:

BTW: Another problem I have regarding my wireless is it searches very long for an IP on boot (via DHCP), my lan-card on the other hand not (also configured with DHCP). Is there some way to fix that?
What about signal strength on the AP? As for the wired or eth0 then post the 'ifconfig -a' and 'route -n'.

ppr:kut 05-10-2007 02:39 AM

Thanks folks,
I have it working. Basically I do removing the module, additionally to 'ifconfig down / up' and 'iwconfig txpower off / on'. Don't know if I need that, though.
My other problem is still not solved, but I think I can give some more information on that. My W-LAN-driver is ipw3945, not included in the kernel and it needs the binary daemon ipw3945d. My LAN-driver is r8169, included in the kernel. Now my poblem is not AP-latency, but searching for an DHCP, where there is none. So booting up with DHCP-Search enabled on just the LAN does fine, but booting up with WLAN additionally or even only results in a long search for an ip, if I'm not connected to anything.
If I'm connected everything is fine. It's just the case where I'm working 'stand-alone'.

Hope there's someone out who can help me on that.

BCarey 05-10-2007 10:23 AM

So you need to start the daemon before bringing up the internet. Try modifying /etc/rc.d/rc.M.

Brian

bioe007 05-10-2007 07:54 PM

for DHCP times this is a simple way I found on a thread here:

Code:

echo "/etc/rc.d/rc.inet1:  /sbin/dhcpcd -d -t ${DHCP_TIMEOUT[$i]:-20} ${DHCP_OPTIONS} ${1} &" | $LOGGER
        /sbin/dhcpcd -d -t ${DHCP_TIMEOUT[$i]:-20} ${DHCP_OPTIONS} ${1} &

note the '&' to send your dhcpcd request to the background. this really speeds up boot times with or without being plugged in or near a network. some have said this is not good practice (sorry I can't remember where the thread is) but its working fine for me.

ppr:kut 05-11-2007 02:43 AM

Quote:

So you need to start the daemon before bringing up the internet. Try modifying /etc/rc.d/rc.M.
Yes, but I do already have a working modprobe-rule, which does this automatically, so loading the daemon is not the problem.
Yesterday I testes my LAN-Setup again, and recognized that I have the same problem there too. Now I remember exactly that I had a working setup, where my LAN-Card was not searching for an IP on startup, if there is no DHCP available on network, but it did, when there was one.
On the solution with '&'. It's not perfect, but I'll probably use it, though I would like to have a better solution.

SwissHeritage 03-25-2009 10:24 PM

Reconnecting after a dropped connection
 
The best solution I've found so far is is the one given by BCarey: remove and reload the driver, then restart the connection. In my case, with my wireless connection, that's:

rmmod ath5k
modprobe ath5k
/etc/rc.d/rc.inet1 wlan0_restart

I suppose I can put that in a script, but it's still annoying to have to run a script every time I lose the connection. Is there anything in the slackware distribution that I can use to monitor the connection, and automatically reconnect when it drops? Also, can anyone point me to an article or thread about possible reasons for dropped connections and what to do about them?

onebuck 03-27-2009 08:46 AM

Hi,

Old Post!

You could do a search here on LQ as your problem has been covered.

Try wicd.


All times are GMT -5. The time now is 10:39 AM.