I have recently run into a very frustrating problem on my raspberry pi 2. Everything has been fine since initial setup (~5 weeks). I have a hidden WiFi SSID, but once I figured out how to set that up with the Pi, everything worked great.

Suddenly, this morning, I was getting 50-70% packet loss with ping (LAN or WAN) and connecting via SSH over LAN (wifi) was extremely slow and laggy.

pinging any local machine that was connected to my network via wifi or ethernet was giving large packet loss. Connecting via SSH with PuTTY was slow to connect (~10s) and after I connected, typing would be extremely slow and laggy, and would often freeze up entirely. I hooked the Pi back up via HDMI to troubleshoot, and typing was fine in the terminal (so it wasn't just my Pi being slow).

Long story short, I ended up setting up a static IP on the Pi and on my router, which has apparently resolved both the packet loss issue and the slow SSH issues (which are related, obviously). My question is:

  • why might this problem occur?
  • what diagnostics can I try next time this happens to figure out the cause?
  • why does setting a static IP fix the problem?

Here is my setup and configuration:

  • Model: Raspberry Pi 2 Model B+
  • Linux version: Raspbian Wheezy, Linux rpi 4.1.7-v7+ #817 SMP PREEMPT Sat Sep 19 15:32:00 BST 2015 armv7l GNU/Linux
  • WiFi adapter: Canakit WiFi dongle, RT5370 chipset


auto lo

iface lo inet loopback
iface eth0 inet static

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
wireless-power off

iface default inet static


ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev


  • 1
    When this kind of thing happens to me I usually just kill and restart the dhcp client, although it usually only happens on machines that can actually sleep (i.e., can disappear from the network). Dunno how to do that with the normal networking config though, maybe try service dhcpd restart. Worth consulting: raspberrypi.stackexchange.com/q/37920/5538
    – goldilocks
    Commented Dec 6, 2015 at 19:58
  • what does output of ip addr say? I had a problem wherein my wlan0 had 2 ip addresses assigned to it and it caused some issues like this.
    – tejas
    Commented Aug 15, 2016 at 15:24
  • what is the quality on the WiFi? Can be checked with "iwlist wlan0 scan".
    – MatsK
    Commented Aug 26, 2017 at 6:55

1 Answer 1


May not be your problem, but I've seen odd things when two Linux IP interfaces (such as eth0 and wlan0) are on the same subnet (192.168.1.*). Sends can go out one interface and resonses come in on the other. The IP packets were given to TCP OK, but the asymmetry caused TCP/IP stack internal problems causing delays, timeouts and dropped connections.

My solution for wired and wireless LANs connected to a system is to use different subnets, e.g. 192.168.1.* and 192.168.2.*. The subnet IP address is typically configured using a web interface to each wired/wireless router. This configures the DHCP server in the router.

  • 1
    This is interesting. Could you edit your answer to include how one might resolve this issue? Commented Dec 14, 2015 at 14:32
  • This will not happen, the routing table have different metric for the different interfaces. Check with "route -n" and look what the metric column is saying for the different interfaces.
    – MatsK
    Commented Aug 26, 2017 at 6:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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