ifupdown and dhclient for ipv6

If you're using dhcp for both ipv4 and ipv6 on ubuntu with wifi/wpa_supplicant you might have faced with weird issue with ifdown trying to release v6 (or v4, depends on ordering) lease and it finally hangs - since previous address family already brought interface down.

Since it is really wifi/wpa_supplicant specific (supplicant is stoppped by first stanza) easy workaround for that would be to add wpa check/reconnect before trying release, if it fails - entire sequence aborts.

auto wlan0
iface wlan0 inet dhcp
    wpa-driver nl80211
    wpa-conf /etc/wpa_supplicant/wpa.conf
    wpa-wait 60
iface wlan0 inet6 dhcp
    accept_ra 1
    autoconf 1
    pre-down wpa_cli -i$IFACE reconnect 2>/dev/null

Easy as that. The actual workaround is the very last line, the rest is just my own configuration. Here we simply trying to ask wpa to reconnect to the wifi network. If v4 family (first) already brought it down - supplicant will be dead, command will return error, pre-down section will fail, down sequence will abort. The job is done.

Fri Dec 28 12:27:32 2012 Upd.: Sat Feb 9 14:50:45 2013
© ruff 2011