Gachto
Posts: 4
Joined: Sat Feb 09, 2019 12:25 pm

RPI can't access internet

Sat Feb 09, 2019 12:49 pm

Hello,

I am a beginner with RPi 3 and recently I discovered that i can't access to the internet (curl, apt-get update doesn't work) could you help me out with this issue ? I use a router to connect (with ethernet cables) my raspberry and my laptop (using Linux with an USB stick Ubuntu 18.04)

Here some informations :

Code: Select all

ping -c3 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.

--- 8.8.8.8 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2005ms

Code: Select all

ping google.com
ping: unknown host google.com
my router local adress :

Code: Select all

ping 192.168.0.1
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
64 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=14.6 ms
64 bytes from 192.168.0.1: icmp_seq=2 ttl=64 time=0.814 ms
64 bytes from 192.168.0.1: icmp_seq=3 ttl=64 time=0.673 ms
64 bytes from 192.168.0.1: icmp_seq=4 ttl=64 time=0.681 ms
^C
--- 192.168.0.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 0.673/4.196/14.619/6.018 ms
my laptop local adress :

Code: Select all

ping 192.168.18
PING 192.168.18 (192.168.0.18) 56(84) bytes of data.
64 bytes from 192.168.0.18: icmp_seq=1 ttl=64 time=0.575 ms
64 bytes from 192.168.0.18: icmp_seq=2 ttl=64 time=0.580 ms
64 bytes from 192.168.0.18: icmp_seq=3 ttl=64 time=0.579 ms
64 bytes from 192.168.0.18: icmp_seq=4 ttl=64 time=0.488 ms
64 bytes from 192.168.0.18: icmp_seq=5 ttl=64 time=0.588 ms

Code: Select all

cat /etc/resolv.conf
# Generated by resolvconf
nameserver 192.168.0.1
about this one, i tried to add nameserver 8.8.8.8 manually but it keeps on getting back to this original code

Code: Select all

cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

allow-hotplug wlan1
iface wlan1 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

Code: Select all

cat /etc/hosts
127.0.0.1	localhost
::1		localhost ip6-localhost ip6-loopback
ff02::1		ip6-allnodes
ff02::2		ip6-allrouters

127.0.1.1	myPi

Code: Select all

cat /etc/wpa_supplicant/wpa_supplicant.conf
country=GB
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
    ssid="mySSID"
    psk="myPSWD"
}
Thank you for reading me

P.S. : Sorry for any mistakes, English it's not my first language

User avatar
rpdom
Posts: 13889
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: RPI can't access internet

Sat Feb 09, 2019 1:06 pm

Ok, so your local network connection to the router is working.

But you can't connect to external systems (ping 8.8.8.8 failed).

This suggests that it is a routing issue - your Pi doesn't know that it needs to go via your router to get to external systems or the router is refusing to route data.

This is unusual, because normally the router will tell the Pi which gateway to use when it issues the IP address.

Can you show us the output of ip route?

Don't worry about the nameserver for now. It is common for routers to act as a nameserver for the local network and forward on any requests they can't handle themselves.
Signature is on holiday.

Gachto
Posts: 4
Joined: Sat Feb 09, 2019 12:25 pm

Re: RPI can't access internet

Sat Feb 09, 2019 3:50 pm

Thank you for your answer!

Here for the ip route:

Code: Select all

ip route
default via 192.168.0.1 dev eth0  metric 202 
192.168.0.0/24 dev eth0  proto kernel  scope link  src 192.168.0.17  metric 202 

User avatar
rpdom
Posts: 13889
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: RPI can't access internet

Sat Feb 09, 2019 4:20 pm

That looks like the settings on your Pi are correct too. It seems your router isn't allowing internet access from the Pi for some reason.
Signature is on holiday.

Gachto
Posts: 4
Joined: Sat Feb 09, 2019 12:25 pm

Re: RPI can't access internet

Sun Feb 10, 2019 9:21 am

Ok thank you,

I will try to change the router and see how it goes!

pcmanbob
Posts: 5650
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: RPI can't access internet

Sun Feb 10, 2019 11:23 am

Gachto wrote:
Sun Feb 10, 2019 9:21 am


I will try to change the router and see how it goes!
before doing that try powering every thing off , the pi and the router and any PC's , leave everything off for a minute or so then power the router allow it to complete its start up cycle and only then power the pi and any PC's.

you may find every thing will work correctly after doing this.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

Gachto
Posts: 4
Joined: Sat Feb 09, 2019 12:25 pm

Re: RPI can't access internet

Wed Feb 13, 2019 3:19 pm

Ok, i finally had internet !
The issue was indeed the router; it doesn't allow the internet connexion.... In order to have internet connexion without it I just used a Wifi dongle and my PC and the pi are directly connected.

Thank you again!

Return to “Troubleshooting”