Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

while [ 1 ]
    ping -c1 > /dev/null
    if [ $? = 1 ]
        sh /etc/netstart ral0 > /dev/null
    sleep 30

[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
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 every 30 seconds:

# /etc/ifstated.conf

net = '( "ping -nq -c 3 -w 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 '14 at 23:10

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .