Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I’m running OpenBSD on a computer which is connected via wireless to the network. It is a well supported NIC and I’ve had no problems with it from a hardware perspective.

Unfortunately my wireless access point occasionally loves to forget it’s settings. I then have to help it remember. However, in this intervening time my OpenBSD box drops the connection and then does not automatically reconnect. I have alleviated my problems by running this simple script in the background:

#!/bin/sh
while [ 1 ]
do
    ping -c1 192.168.1.254 > /dev/null
    if [ $? = 1 ]
    then
        sh /etc/netstart ral0 > /dev/null
    fi
    sleep 30
done

[Ping the access point. If there is no response attempt to reconnect.]

It seems to me to be a very suboptimal solution. Has anyone else come across a better way?

share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

I have the same problem once in a while with VirtIO network device under Qemu/KVM. I've workaround the issue with ifstated(8):

# grep -e ^ifstated /etc/rc.conf.local
ifstated_flags=                 # enabled

The daemon is configured to ping default gateway 172.16.0.1 every 30 seconds:

# /etc/ifstated.conf

net = '( "ping -nq -c 3 -w 1 172.16.0.1 > /dev/null 2>&1" every 30 )'

state auto {
        if ! $net {
                run "ifconfig vio0 down up"
        }
}

Unfortunately above solution is in nature, the same as yours.

share|improve this answer
    
Thanks for pointing out ifstated; it looks very much more suited to this task. I'm going to try this out soon! –  casr Feb 23 at 23:10
add comment

I don't think I understand. You said your wireless AP likes to forget it's settings. What does this have to do with your NIC? Do you mean your NIC forgets the AP settings?

share|improve this answer
    
Sorry for being a bit free with my language. The problem stems from having an unreliable AP. For unknown reasons, it will turn off and come back on again. When this happens the NIC on the OpenBSD machine will disconnect. It doesn’t lose the connection settings but it doesn’t reconnect either. So the question is this: can the NIC detect when it’s disconnected from the AP and subsequently reconnect to it (if it is detected)? –  casr Feb 15 '11 at 15:27
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.