0

I have my raspberry pi connected to my router and a laptop also connected to the router. I can SSH to the pi from the laptop perfectly. However, when I try to install something it says "connection to host failed [my router's ip address 80]". When I try to ping google I get a 100% packet loss rate.

My Ethernet light is blinking as if data were being transmitted though and when I run ifup eth0 i get a message saying its already configured. My resolv.conf file has my router's ip as a nameserver and my interfaces file is set up for dhcp. ifconfig shows my eth0 with an IP of 192.168.0.9.

This is a fresh install of Minibian(basically Rasbian but without extra features.) I also tried it with Rasbian and had the same issue. What could the issue be?

  • With ethernet, the most unequivocal way check whether the problem is on the pi or elsewhere is by running a packet sniffer such as wireshark on some other computer also on the same ethernet LAN (it's also possible on wifi, but there are complications). If that system can see the packets going out, then they went out -- the problem is not the pi. If it didn't, then it is. By way of explanation: all transmissions on a wired subnet are visible to all nodes on that subnet, always. – goldilocks Aug 14 '15 at 20:32
  • Are you sure the IP of your nameserver is the same as the IP of your router? If so, that should not be; your router is almost certainly not a nameserver. When you say pinging google fails, is that using google.com, or an actual IP address? – goldilocks Aug 14 '15 at 20:41
  • OK...I really have no idea what a nameserver is but yes the ip in resolv.conf and the ip of my router currently are the same. When I ping I tried the commands, ping www.google.com and ping 8.8.8.8. Both started the ping command which I Ctrl c'ed after a couple of seconds and it said so many packets failed. – NULL Aug 14 '15 at 20:56
  • I guess the router could be set up to forward to your ISP's actual nameservers, I dunno all the possible schemes there. But pinging an IP address doesn't require a nameserver, so that does imply you have no inet. What about pinging the router? – goldilocks Aug 14 '15 at 21:10
  • Ok, Ill try that. – NULL Aug 14 '15 at 21:12
1

Based on what's working (pinging local IP addresses), you know:

  • Your basic network is working properly.
  • You are getting a working IP address (via dhcp).
  • You are able to communicate on the local subnet (can ssh to RPi, can ping router from RPi).

All good news, since you've eliminated a lot of things as the problem (bad cabling, defective hardware). To communicate off the local subnet with IP, your RPi needs to have a properly configured default gateway. Enter the ip route command. You should see a line that says default via <router ip>. If not, that's likely your problem. Check to make sure your dhcp server (likely your router) is giving out a default gateway with the address lease.

If your routing is correct, you should be able to ping external IP address (e.g. ping 8.8.8.8 for google). If that still doesn't work, it is possible that your router is not forwarding traffic (doing Network Address Translation - NAT) for the RPi, but I'd say this is unlikely since it sounds like other computers can get out.

If you get to where you can ping external addresses by IP address (e.g. ping 8.8.8.8) but not by name (e.g. ping google.com), then you have a dns issue. Try using a "known good" dns server such as google's at 8.8.8.8 and try again.

  • ip route gives default via "router ip" dev eth0. – NULL Aug 15 '15 at 17:36
  • If your default gateway is set and you're able to ping the IP address of the default gateway, there's not much more you can do on the RPi. You're going to have to look at the router and why it is treating the RPi differently. Presumably your laptop can get out to the Internet, right? Compare the configuration of the RPi and laptop to see if anything obvious is different. What is OS on laptop? Are the laptop and RPi getting IP addresses in the same range? Are the subnet masks the same? I'd take a look at the router settings to see if it's doing any sort of filtering or traffic restrictions. – bobstro Aug 16 '15 at 1:12
  • Running Ubuntu on laptop with similar IP. Laptop can access internet. Yes it must be some sort of filtering maybe by the mac address. – NULL Aug 17 '15 at 13:37
1

that address of [my router's ip address 80]is not accurate. The 80 is probably the port being ID'ed. Your router's address is probably 192.168.1.1 (for linksys), and these are all INTERNAL addresses, invisible to the internet,(hopefully). I've found that the lease used in a previous RPi session is probably still registered with the router. You can check this by entering the router's address into the browser, the credentials window will come up next, then navigate to the DHCP table, usually in the fist tab, and check each device's address connected to your router. Rather then fudging with the router settings of leasing & releasing, taking a coffee break, after shutting down the RPi & rebooting the router, & letting the router discover the RPi after the reboot, has worked for me!

  • I recognise that IP of 192.168.0.9. Are you using an Edimax product, maybe a Wi-Fi extender.... – iDug Aug 14 '15 at 20:27
  • Nope that's just the IP my router assigned the pi when I plugged it in. – NULL Aug 14 '15 at 20:58
  • Would pulling out power from router and replugging have the same effect? IDK how to reboot. :-) – NULL Aug 14 '15 at 21:00
  • That didn't work. Goldilocks suggests its a router issue. – NULL Aug 14 '15 at 21:34
  • What type of router please? – iDug Aug 14 '15 at 22:17

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.