You are not logged in.

#1 2009-10-01 14:57:41

m_ad
Member
Registered: 2009-09-24
Posts: 36

[SOLVED] Wireless network goes down

I have been using Arch for a few weeks now. I setup the wireless network in /etc/rc.conf, and it starts during boot. Just a few days ago, after the box being on for a few hours I had no network connection (ping didn't work, webpages couldn't load).

I didn't think much of it, but now it's happening more often. I really don't want to execute all the iwconfig commands that include my network name and key, so I just restart and it comes back up during reboot.

How can I prevent this, or if it does go down, what's the best way of bringing it back up?

Thanks for any help.

my rc.conf

wlan0="dhcp"
wlan_wlan0="wlan0 essid **** key **************************"
INTERFACES=(wlan0)

Last edited by m_ad (2009-10-03 15:46:36)

Offline

#2 2009-10-01 15:45:01

Lich
Member
Registered: 2009-09-13
Posts: 437

Re: [SOLVED] Wireless network goes down

I suggest you install wicd, and make it autoconnect to your ap. since it's a daemon you don't even need to run X to have it connect, it connects upon startup.

Last edited by Lich (2009-10-01 15:45:45)


Archlinux | ratpoison + evilwm | urxvtc | tmux

Offline

#3 2009-10-01 16:10:08

m_ad
Member
Registered: 2009-09-24
Posts: 36

Re: [SOLVED] Wireless network goes down

I could try that. In my current setup, I don't need to run X to have my network connect. I have it configured in my rc.conf..

Offline

#4 2009-10-02 15:52:41

m_ad
Member
Registered: 2009-09-24
Posts: 36

Re: [SOLVED] Wireless network goes down

Does anyone else have any other suggestions, besides using wicd? Or is wicd the primary choice for connecting to wireless networks?

Offline

#5 2009-10-02 16:08:03

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: [SOLVED] Wireless network goes down

wicd is good. But if you want alternatives... I sometimes use this script:

#!/bin/bash
killall dhcpcd
ifconfig wlan0 down 
ifconfig wlan0 up
iwconfig wlan0 essid my_net key s:my_pass
dhcpcd wlan0

Then you just chmod +x wireless.sh to make it executable, and ./wireless.sh to run it.
You can even improve it and put it in the background so that it also auto-reconnects for you when the link is dead.

I really don't want to execute all the iwconfig commands that include my network name and key, so I just restart and it
comes back up during reboot.

So you see, that's really unnecessary wink


This silver ladybug at line 28...

Offline

#6 2009-10-02 16:40:48

brenix
Member
From: California
Registered: 2008-03-05
Posts: 185

Re: [SOLVED] Wireless network goes down

m_ad wrote:

Does anyone else have any other suggestions, besides using wicd? Or is wicd the primary choice for connecting to wireless networks?

Maybe use netcfg2?

1. Install it (if not already)
2. Copy a wireless example from /etc/network.d/examples to /etc/network.d
3. Edit the file you just copied to match your network.. (set the timeout value to 50..)
4. Add network-profiles to your daemons array..

Last edited by brenix (2009-10-02 16:43:48)

Offline

#7 2009-10-02 16:53:13

m_ad
Member
Registered: 2009-09-24
Posts: 36

Re: [SOLVED] Wireless network goes down

Thanks to everyone for their input. I'll give these things a try smile

Thanks for the script, lolilolicon. How could I put it in the background?

Offline

#8 2009-10-02 17:23:28

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: [SOLVED] Wireless network goes down

#!/bin/bash

reconnect ()
{
killall dhcpcd
ifconfig wlan0 down
ifconfig wlan0 up
iwconfig wlan0 essid my_net key s:my_pass
dhcpcd wlan0
}

while sleep 1m ; do
    timeout 10s ping -c 3 www.google.com &>/dev/null ||
    reconnect #You may want to redirect the output to some log file.
done

To run this in the background, just put a & after the command, like this:

./wireless.sh &

You may want to put this in your ~/.xinitrc or /etc/rc.local or somewhere... or just type the command by hand.

Edit: Oh, I forgot... You have to be root to run the reconnect function... so make sure you run it as root

Last edited by lolilolicon (2009-10-02 17:33:08)


This silver ladybug at line 28...

Offline

#9 2009-10-03 15:46:20

m_ad
Member
Registered: 2009-09-24
Posts: 36

Re: [SOLVED] Wireless network goes down

Great! Thanks a lot loliloicon. The reason I would rather use the above method(s) is because I don't want to install many apps on this system.

Thanks again!

Offline

Board footer

Powered by FluxBB