13

I'm observing really annoying issues with connectivity to RasPi on WiFi network. I have device connected on both LAN cable and WiFi. If both cable and WiFi dongle are plugged - both interfaces are working fine and I'm able to connect to RasPi through IP addresses of both interfaces.

However, when I unplug the LAN cable - after restart - RasPi becomes unavailable by SSH. If I unplug - till restart - device is still fully available via WiFi interface through SSH! After restart - it cannot be accessed any more.

Here are my settings: /etc/network/interfaces

auto lo

iface lo inet loopback
iface eth0 inet dhcp

auto wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

/etc/wpa_supplicant/wpa_supplicant.conf

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
update_config=1

network={
        ssid="linksys"
        scan_ssid=1
        mode=0
        proto=WPA2
        auth_alg=OPEN
        pairwise=CCMP
        group=TKIP
        key_mgmt=WPA-PSK
        psk="xxx-password-here"
        id_str="raspberrypi-wif"
        priority=1
}

Please, help to identify the reason of the issue.

Ghanima
  • 15,958
  • 17
  • 65
  • 125
Andrey Rubliov
  • 243
  • 1
  • 2
  • 7

3 Answers3

8

Check to make sure your SSH config is set to listen on all interfaces. This will ensure that if the system boots and only WiFi is available, it will listen on the WiFi interface. I suspect this is ok based on your above description, but it is worth checking anyway.

The other thing I would do is watch the boot process via a monitor (if possible, or via dmesg and logs after the fact), to check if the wireless interface is actually available before SSH tries to start.

Depending on your wireless device, it may not be initialized or available at the time the SSH daemon is starting, which causes SSH to fail, and therefore no access to the Pi via SSH after a reboot with wireless only.

Hurgh
  • 391
  • 1
  • 2
3

I had exactly the same issue on a Beaglebone Black. After wasting a day fiddling with /etc/network/interfaces settings, I noticed that eth0 is up/active after boot, even if the network cable is disconnected at boot time (just issue a route command and you will see eth0 listed). This seems to interfere with the connectivity of wlan interface. The cure is deactivating eth0 (ifdown eth0), and alas, the problem is gone for good. Plugging and unplugging the network cable had the same effect (it has the side effect of deactivating eth0). After that, I can ping/ssh wlan0 interface from any device in my home network. Guess that I shall write some script for detecting at boot time whether eth cable is plugged or not, and shutting down eth0 if it isn't.

Angel
  • 31
  • 1
-3

For what it's worth, I was having the same trouble (ssh fine via ethernet, no go via wifi), and I found that the wlan0 in the /etc/network/interfaces was set to manual, rather than dhcp. Changed it and started working ok after reboot