I was trying to connect my Raspberry Pi 3 Model B over Ethernet to my netbook(running Kali from a bootable USB). After a lot of struggle that the RPi automatically assigned an IP to itself when connected to my Windows laptop (running Windows 8.1 Pro x64), using a standard LAN cable which was simply plugged into the Ethernet ports on the RPi and my Windows laptop. The IP wouldn't change across reboots. I tried pinging that IP from my laptop and I could do that, then I tried SSHing into it using puTTY and the same IP and I was able to do that as well even after rebooting both my RPi and my laptop.

Now when I came back home (I did all that at my neighbor's house as I don't have any HDMI output screen for the RPi) and tried to SSH into the Pi using the same IP, it gave me an error saying-

connect: Network was unreachable.

I couldn't even ping it, got the same error. I used this command for SSH:- ssh pi@ I tried switching off WiFi on my Kali netbook but that didn't help, as of now I don't have any idea of what to do.
I can SSH into the Pi using puTTY on Windows(can even use programs such as IDLE and leafpad etc in GUI using Xming) just fine but I can't do the same using Kali, even when the IP for the RPi stays the same...

I was playing around with my Pi at my neighbor's and found that the IP I got which hostname -I( was different from the hostname -i( I immediately tried pinging the second IP from my Kali netbook and voila! I could! But when I tried connecting over SSH, it gave an error saying "Connection Refused". Now how to resolve that?

EDIT 2 :-
I can ssh into the pi from the pi using both the IPs. Using the second IP (i.e gives the connection refused error from puTTY as well. I am still able to SSH into the Pi using puTTY and the first IP (i.e

  • 1
    When you came back home, how is the RasPi is connected to your home network ? Using a cable to the router, some sort of wifi or still connected to your win8.1 box using an ethernet cable ? What are the IP addresses of your windows machine and RasPi, including the netmask values ? – MelBurslan Apr 5 '16 at 19:43
  • seems to be a link-local IP address, which may be why your Kali netbook is unable to reach it. – Léo Lam Apr 5 '16 at 20:19
  • To amplify previous comment. Link Local IP addresses are allocated with random numbers. What you got at one house does not stay fixed when you boot at another. It is a new random number – infixed Apr 5 '16 at 20:38
  • @MelBurslan The RPi is connected via an ethernet cable directly to my Pi. The IP of my Pi stays the same (i.e, the IP for Windows is set to obtain automatically and I usually find that its something like 169.254.x.x where x is some random number. netmask is on both systems (I'll cross check this one though). – YaddyVirus Apr 6 '16 at 8:39
  • @infixed well this doesn't seems to be a link local IP. I tried to connect to the Pi using SSH and it worked, all while typing this comment – YaddyVirus Apr 6 '16 at 8:46

Okay this is a workaround, I wouldn't call it a solution. I went to my neighbor's house, hooked up the RPi to the HDMI display, connected it to internet via my phone's hotspot and downloaded the VNC client. I then SSHd into it using my Windows laptop and got access to the desktop. I then again connected it to my phone's hostspot, got the IP using hostname -I and tried sshing in from my Kali netbook, and it worked. I haven't tried VNC but I'm pretty sure it would work.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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