csc2ya
Posts: 8
Joined: Wed Dec 04, 2013 1:39 am

[Fixed] unreachable from other machines

Sat Dec 28, 2013 8:24 pm

I got a Model B Pi for christmas, and have played around with it quite a lot since then, initially using NOOBS to try the different os's

I've now got the sd card imaged with the latest raspian image from the downloads page.

It seems that either network routing or something else is messed up though.

I have set it to get an ip via dhcp from my router, which it is connected to via wireless. I have set my router to give the pi a static ip, and this works for internet access..

However, I cannot connect via ssh, and pings from other computers on my network do not appear to reach it.

I've checked that the ip is correct, and ssh is running when I check it via the terminal.

I also had the same issue when I was running raspian via NOOBS.

In other os images (like raspbmc and xbmc), remote access to it does not work to it despite it being connected to my network and able to access the internet.

When trying via raspian, I have actually uninstalled UFW (via sudo apt-get remove --purge ufw) to rule out connections being blocked.

When pinging the pi from another computer on the network it comes back with:

Code: Select all

Pinging 192.168.1.74 with 32 bytes of data:
Reply from 192.168.1.51: Destination host unreachable.

Ping statistics for 192.168.1.74:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss)
(.51 is my laptop that I am pinging it from).

On trying a tracert from my laptop, this also returns the same error:

Code: Select all

tracert 192.168.1.74

Tracing route to 192.168.1.74 over a maximum of 30 hops

  1  WinServ [192.168.1.51]  reports: Destination host unreachable.

Trace complete.
On attempting to ping my laptop from the pi, I also get destination host unreachable.
Last edited by csc2ya on Mon Dec 30, 2013 12:25 am, edited 1 time in total.
Model B 512MB Running Raspian Wheezy (piserv.csc2ya.co.uk)
Dedicated server running Ubuntu 12.04 (cshellz.co.uk)
Contact me by PM for a free shell account on either machine.
http://qdb.csc2ya.co.uk
http://thesoundoftrance.co.uk

User avatar
default_user8
Posts: 680
Joined: Mon Nov 18, 2013 3:11 am

Re: unreachable from other machines

Sat Dec 28, 2013 11:34 pm

Does the raspi appear on the dhcp client list on your router web management page? If not then it's not getting an IP addy from your router.
Last edited by default_user8 on Sun Dec 29, 2013 5:01 am, edited 2 times in total.
Two heads are better than one, unless one's a goat head.

csc2ya
Posts: 8
Joined: Wed Dec 04, 2013 1:39 am

Re: unreachable from other machines

Sat Dec 28, 2013 11:49 pm

Yes....it's definately getting an ip address. ifconfig shows the ip address that it is getting from my router via dhcp, and it also shows up on the router web interface. I have also set my router to always assign it the same ip.

I did try configuring an ip address manually, but lost all network connectivity from it when doing this (may not have set up the interfaces config file correctly for wireless) and so reverted to a dhcp assigned ip.

I can also get on the internet from the pi itself, but pinging the pi does not work. I can ping wan ip's from the pi (google for example), but attempting to either ping the pi from another device on my network, or pinging a local ip like my laptop, or even my router ip both fail with 'destination host unreachable'.
Model B 512MB Running Raspian Wheezy (piserv.csc2ya.co.uk)
Dedicated server running Ubuntu 12.04 (cshellz.co.uk)
Contact me by PM for a free shell account on either machine.
http://qdb.csc2ya.co.uk
http://thesoundoftrance.co.uk

User avatar
default_user8
Posts: 680
Joined: Mon Nov 18, 2013 3:11 am

Re: unreachable from other machines

Sun Dec 29, 2013 5:00 am

Are you sure that your PI is on the same subnet? In your attempt to set an IP manually you mave have succeded. Make sure your PI is in the same subnet as the rest of you devices.
Two heads are better than one, unless one's a goat head.

csc2ya
Posts: 8
Joined: Wed Dec 04, 2013 1:39 am

Re: unreachable from other machines

Sun Dec 29, 2013 5:19 pm

I now have the PI connected wirelessely to my router, and internet access from it works (I'm writing this post from it right now).

However, I still cannot ping other machines on my network from the PI (pinging extenal sites like google works though), ping the PI from other machines, or connect from my laptop to the PI via ssh (ssh is definately running).

My interfaces file contains the following:

Code: Select all

auto lo

iface lo inet loopback
iface wlan inet static
address 192.168.1.74
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.254

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
Model B 512MB Running Raspian Wheezy (piserv.csc2ya.co.uk)
Dedicated server running Ubuntu 12.04 (cshellz.co.uk)
Contact me by PM for a free shell account on either machine.
http://qdb.csc2ya.co.uk
http://thesoundoftrance.co.uk

RandomPerson
Posts: 18
Joined: Fri Dec 13, 2013 11:39 pm

Re: unreachable from other machines

Sun Dec 29, 2013 9:25 pm

I tried that IP and it did not work

User avatar
default_user8
Posts: 680
Joined: Mon Nov 18, 2013 3:11 am

Re: unreachable from other machines

Sun Dec 29, 2013 9:54 pm

I still think you have a routing issue, what is the IP of one of the other machines on your network? I assume that all the other machines on the network can see each other.
random person, that is a local IP and not his public IP so it's not going to let you see any of his machines.

I don't understand why everyone wants to have the pi set it's own static IP, when it's easier just to let the router handle it for them.
Two heads are better than one, unless one's a goat head.

csc2ya
Posts: 8
Joined: Wed Dec 04, 2013 1:39 am

Re: unreachable from other machines

Sun Dec 29, 2013 10:54 pm

My laptop has a static ip of 192.168.1.51. All other machines with the exception of the Pi (dad's laptop, my phone, xbox 360, Nexus 7, Blu-Ray Player) have dynamic ip's assigned by the router. It does appear however, that the pi cannot see other machines with the exception of the router, and no other machines can see the Pi (it does appear in the client list on the router though).

I did have the Pi set to get it's ip by dhcp originally, and just set the router to always assign it the same ip, but had the same problem.

I want to leave it set to a static ip, as it makes it easier to do port forwarding later on.

I've tried setting the PI to a static ip outside of the DHCP range and lost all network connectivity in raspian.

I'm now seriously thinking about just getting rid of the Pi as from what i've read, it should just work, but even using DHCP, ssh simply does not work. I'm of the opinion that this one is more or less fubared.

I would love the pi if it worked properly for what I want it to do (accept ssh connections from anywhere) but this is proving impossible.
Model B 512MB Running Raspian Wheezy (piserv.csc2ya.co.uk)
Dedicated server running Ubuntu 12.04 (cshellz.co.uk)
Contact me by PM for a free shell account on either machine.
http://qdb.csc2ya.co.uk
http://thesoundoftrance.co.uk

User avatar
default_user8
Posts: 680
Joined: Mon Nov 18, 2013 3:11 am

Re: unreachable from other machines

Sun Dec 29, 2013 11:16 pm

try this,
From your pi go to this web page and find your public ip,
http://www.yougetsignal.com/tools/open-ports/
Verify that your ssh port is forwarded in your router and try to ssh into your pi with your public ip address. If that still doesn't work i can only suggest that you reflash your SD card and start over from scratch. Try a wired connection first and then try a wireless connection.

Don't give up yet, I had always planned on stuffing an old desktop with hard drives and running freenas for a home nas, but i ran accross the raspberry pi almost by accident one day on the lifehacker website. I now have my home nas built around my pi at a fraction of the cost of what i would have spent going with freenas not to mention my current setup will burn $10USD or less of energy a year compared to what that old desktop would have cost me to run.
PS, Check your IP range that your router is using, is your PI set to an IP addy that is outside the set range?
Last edited by default_user8 on Sun Dec 29, 2013 11:51 pm, edited 1 time in total.
Two heads are better than one, unless one's a goat head.

csc2ya
Posts: 8
Joined: Wed Dec 04, 2013 1:39 am

Re: unreachable from other machines

Sun Dec 29, 2013 11:50 pm

All this time, I never actually thought about trying to access it externally. I have just rebuilt the sd card, reconnected the pi to my wireless using dhcp.

After forwarding port 22, then using dns pointed to my external ip, I managed to get an ssh connection to the pi.

I'm unsure why it won't work using the lan ip (it should work locally as well as far as i'm aware), but really I just wanted to get ssh connections working in any shape or form.

Thankyou so much for all the help :D
Model B 512MB Running Raspian Wheezy (piserv.csc2ya.co.uk)
Dedicated server running Ubuntu 12.04 (cshellz.co.uk)
Contact me by PM for a free shell account on either machine.
http://qdb.csc2ya.co.uk
http://thesoundoftrance.co.uk

User avatar
default_user8
Posts: 680
Joined: Mon Nov 18, 2013 3:11 am

Re: unreachable from other machines

Sun Dec 29, 2013 11:56 pm

If you still can't ssh locally i'd suggest changing the port that ssh uses since it is a common port that will leave you open to attack by a port scanner. You can change it to anything you want externally and just forward that port to port 22 internally.
Two heads are better than one, unless one's a goat head.

csc2ya
Posts: 8
Joined: Wed Dec 04, 2013 1:39 am

Re: unreachable from other machines

Mon Dec 30, 2013 12:03 am

I'm just about to do that actually.

Will change it in the ssh config, then forward that port instead.
Model B 512MB Running Raspian Wheezy (piserv.csc2ya.co.uk)
Dedicated server running Ubuntu 12.04 (cshellz.co.uk)
Contact me by PM for a free shell account on either machine.
http://qdb.csc2ya.co.uk
http://thesoundoftrance.co.uk

csc2ya
Posts: 8
Joined: Wed Dec 04, 2013 1:39 am

Re: [Fixed] unreachable from other machines

Wed Jan 01, 2014 2:17 am

After having the pi become unreachable via ssh every 24 hours, and finding that the dhcp lease expired every 24 hours (can't set it to not expire at all on my router unfortunately), and having to reboot the pi to renew it, I looked around for how to get it working with a static ip, and now have it working with the following in interfaces.conf:

Code: Select all

auto lo

iface lo inet loopback
iface wlan0 inet static
        address 192.168.1.80
        netmask 255.255.255.0
        gateway 192.168.1.254
        wpa-essid *hidden*
        wpa-psk *hidden*

allow-hotplug wlan0
iface eth0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
I then entered one of google's nameserver ip's into /etc/resolv.conf, and then crossed my fingers and rebooted. After rebooting, I can connect to the pi while having it use a static ip

I may not need the wpa-roam part now, but networking complains on restart about missing lines if I remove or comment it out, so I've left it there to keep it happy.
Model B 512MB Running Raspian Wheezy (piserv.csc2ya.co.uk)
Dedicated server running Ubuntu 12.04 (cshellz.co.uk)
Contact me by PM for a free shell account on either machine.
http://qdb.csc2ya.co.uk
http://thesoundoftrance.co.uk

Return to “Troubleshooting”