On Thu, May 26, 2016 at 4:35 AM, Andrew Shadura <and...@shadura.me> wrote: > On 26 May 2016 at 09:16, Russell Stuart <russell-deb...@stuart.id.au> wrote: >> auto wifi_interface >> iface wifi_interface inet dhcp >> pre-up systemctl stop wpa_supplicant || : >> post-down systemctl start wpa_supplicant || : >> wpa-driver nl80211,wext,wired >> wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf > > There's no need in any of this, ifupdown already supports this mode > without anything apart from wpa-conf. > > See /usr/share/doc/wpasupplicant/README.Debian.gz for more details.
Ok, this approach does work if rfkill is added to the equation. I tried it originally and it didn't seem to. The problem is that my card boots up with rfkill activated, and ifup doesn't seem to know about this and reacts strangely. After boot, it ends up with the interface activated but not working such that a subsequent ifup fails, then ifdown succeeds, then ifup fails differently (when rfkill not used). Oddly, when an interactive ifup wlan0 fails, the interface doesn't end up partly configured: after turning on the radio, a subsequent ifup wlan0 succeeds. It took a while to sort this out. It seems to me that either: ifup should make sure to rfkill unblock wifi or the like, or ifup should fail and leave the interface fully unconfigured on boot Here's a log showing the current behavior: [bootup] $ su Password: root@debian:/home/bkerin# ping www.google.com ping: unknown host www.google.com root@debian:/home/bkerin# ifup wlan0 ifup: interface wlan0 already configured root@debian:/home/bkerin# ifdown wlan0 RTNETLINK answers: No such process Killed old client process Internet Systems Consortium DHCP Client 4.3.1 Copyright 2004-2014 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ Listening on LPF/wlan0/a4:34:d9:c0:1f:f7 Sending on LPF/wlan0/a4:34:d9:c0:1f:f7 Sending on Socket/fallback DHCPRELEASE on wlan0 to 192.168.43.1 port 67 send_packet: Network is unreachable send_packet: please consult README file regarding broadcast address. dhclient.c:2331: Failed to send 300 byte long packet over fallback interface. root@debian:/home/bkerin# ifup wlan0 Internet Systems Consortium DHCP Client 4.3.1 Copyright 2004-2014 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ RTNETLINK answers: Operation not possible due to RF-kill Listening on LPF/wlan0/a4:34:d9:c0:1f:f7 Sending on LPF/wlan0/a4:34:d9:c0:1f:f7 Sending on Socket/fallback DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 5 send_packet: Network is down dhclient.c:1966: Failed to send 300 byte long packet over wlan0 interface. receive_packet failed on wlan0: Network is down DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 11 send_packet: Network is down dhclient.c:1966: Failed to send 300 byte long packet over wlan0 interface. DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 12 send_packet: Network is down dhclient.c:1966: Failed to send 300 byte long packet over wlan0 interface. DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 14 send_packet: Network is down dhclient.c:1966: Failed to send 300 byte long packet over wlan0 interface. DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 17 send_packet: Network is down dhclient.c:1966: Failed to send 300 byte long packet over wlan0 interface. DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 2 send_packet: Network is down dhclient.c:1966: Failed to send 300 byte long packet over wlan0 interface. No DHCPOFFERS received. No working leases in persistent database - sleeping. RTNETLINK answers: Network is down run-parts: /etc/network/if-up.d/avahi-autoipd exited with return code 2 Failed to bring up wlan0. root@debian:/home/bkerin# rfkill unblock wifi root@debian:/home/bkerin# ifup wlan0 Internet Systems Consortium DHCP Client 4.3.1 Copyright 2004-2014 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ Listening on LPF/wlan0/a4:34:d9:c0:1f:f7 Sending on LPF/wlan0/a4:34:d9:c0:1f:f7 Sending on Socket/fallback DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 4 DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 4 DHCPREQUEST on wlan0 to 255.255.255.255 port 67 DHCPOFFER from 192.168.43.1 DHCPACK from 192.168.43.1 bound to 192.168.43.103 -- renewal in 1698 seconds. root@debian:/home/bkerin# ping www.google.com PING www.google.com (216.58.194.164) 56(84) bytes of data. 64 bytes from sfo07s13-in-f4.1e100.net (216.58.194.164): icmp_seq=1 ttl=52 time=105 ms Britton