GorilaCabreado
Posts: 8
Joined: Wed Jul 17, 2019 12:47 pm
Location: Spain

Destination Host Unreachable

Wed Jul 17, 2019 12:57 pm

Hi everybody! I'm new with RaspberryPi and I'm trying to get it to ping google.com or even the nameservers 8.8.8.8 and 8.8.4.4 and it'll just reply with 'Destination Host Unreachable'. I have looked through many other discussions in the forum trying to find the solution to my problem but nothing has worked. I'll try to spare you some time by showing what comes up when I command certain things that I've seen on other discussions.

Code: Select all

[email protected]:~ $ ifconfig
eth0      Link encap:Ethernet  HWaddr b8:27:eb:c8:be:46
          inet addr:192.168.1.39  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::d82e:e00c:bd58:4b44/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:638 errors:0 dropped:0 overruns:0 frame:0
          TX packets:793 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:49637 (48.4 KiB)  TX bytes:65978 (64.4 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:28267 errors:0 dropped:0 overruns:0 frame:0
          TX packets:28267 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:1501459 (1.4 MiB)  TX bytes:1501459 (1.4 MiB)

wlan0     Link encap:Ethernet  HWaddr b8:27:eb:9d:eb:13
          inet6 addr: fe80::f59:2e93:f7f1:14da/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:14 errors:0 dropped:14 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1686 (1.6 KiB)  TX bytes:0 (0.0 B)
          
[email protected]:~ $ cat /etc/resolv.conf
# Generated by resolvconf
#OpenDns Servers
nameserver 208.67.222.222
nameserver 208.67.220.220
domain Home
nameserver 192.168.0.1

I don't even know if I have to reset the raspberry to factory settings or whatnot.

Code: Select all

[email protected]:~ $ 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
dns-nameservers 8.8.8.8 8.8.4.4

[email protected]:~ $ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 192.168.1.39 icmp_seq=1 Destination Host Unreachable
From 192.168.1.39 icmp_seq=2 Destination Host Unreachable
From 192.168.1.39 icmp_seq=3 Destination Host Unreachable
^C
--- 8.8.8.8 ping statistics ---
5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3999ms
pipe 3

I'm seriously at a loss here and if anybody could help me I would appreciate it so gratefully because I'm near to pulling all my hairs out.

Thankyou in advance

epoch1970
Posts: 3894
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Destination Host Unreachable

Wed Jul 17, 2019 1:21 pm

GorilaCabreado wrote:
Wed Jul 17, 2019 12:57 pm
I'm near to pulling all my hairs out.
That will not be required I think...
Which OS are you using?
run "lsb_release -a" if you're not sure.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

GorilaCabreado
Posts: 8
Joined: Wed Jul 17, 2019 12:47 pm
Location: Spain

Re: Destination Host Unreachable

Wed Jul 17, 2019 4:02 pm

That's what I get.

Code: Select all

[email protected]:~ $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 8.0 (jessie)
Release:        8.0
Codename:       jessie
A bit more info on this, it's a LoraWan Gateway and I'm using it for a project in uni. The router I was using at school was able to connect to internet and with the LORIOT server, but not the one in my home and that's why it's so frustrating, because it used to work and not anymore. I also read in another discussion that the problem might have been other devices connected through wifi to the router but I directly disabled the router wifi connection to only allow internet through ethernet cable and still no correct connection to the LORIOT server.

Thankyou

epoch1970
Posts: 3894
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Destination Host Unreachable

Wed Jul 17, 2019 4:38 pm

Ok, not exactly a pristine install, there. Will need special attention, I think.

Concentrating on the Ethernet link, I understand the address is given via DHCP on your router?
Then there is one discrepancy that looks suspicious to me:
- The Pi’s address is in network 192.168.1.0/24 (.39 at the moment)
- However, one of the nameservers, a private one, is on an other network. Its address is 192.168.0.1

Could it be possible that in your router at home, the DHCP server is not configured properly and does not match the router’s LAN definition?
In other words: most probably you should see only 192.168.1 or only 192.168.0 in there... Can you check your router?
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

GorilaCabreado
Posts: 8
Joined: Wed Jul 17, 2019 12:47 pm
Location: Spain

Re: Destination Host Unreachable

Wed Jul 17, 2019 5:00 pm

epoch1970 wrote:
Wed Jul 17, 2019 4:38 pm
- The Pi’s address is in network 192.168.1.0/24 (.39 at the moment)
Now that I've reconnected the Pi, it's IP is now 192.168.1.33

Could it be possible that in your router at home, the DHCP server is not configured properly and does not match the router’s LAN definition?
In other words: most probably you should see only 192.168.1 or only 192.168.0 in there... Can you check your router?
Checking my routers configuration now, DNS servers are:
80.58.61.250
80.58.61.254

and according to the output I get from PuTTY:

Code: Select all

[email protected]:~$ cat /etc/resolv.conf
# Generated by resolvconf
#OpenDns Servers
nameserver 208.67.222.222
nameserver 208.67.220.220
domain Home
nameserver 80.58.61.250
nameserver 80.58.61.254
What should I change?

epoch1970
Posts: 3894
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Destination Host Unreachable

Wed Jul 17, 2019 5:03 pm

Do you have an explanation for the disappearance of the 192.168.0.1 nameserver that was shown in your 1st post? Did you correct something?

I think we need to have a look at /etc/dhcpcd.conf, too.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

GorilaCabreado
Posts: 8
Joined: Wed Jul 17, 2019 12:47 pm
Location: Spain

Re: Destination Host Unreachable

Wed Jul 17, 2019 5:09 pm

epoch1970 wrote:
Wed Jul 17, 2019 5:03 pm
Do you have an explanation for the disappearance of the 192.168.0.1 nameserver that was shown in your 1st post? Did you correct something?

I think we need to have a look at /etc/dhcpcd.conf, too.
There you go

Code: Select all

static ip_address= 192.168.1.39/24
static routers=192.168.1
static domain_name_servers=192.168.1
Yes, I changed the static routers and static domain name servers as you said they should be 192.168.1 only or 192.168.0, but not both, so I chose the first one.

epoch1970
Posts: 3894
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Destination Host Unreachable

Wed Jul 17, 2019 5:21 pm

Ok.
Your dhcpcd.conf file is slightly incorrect, but since it is, I think the router has given a DHCP address to the Pi.

Reboot once more without changing anything, then try “ping 8.8.8.8”
Also post the output of “route -n”, after that reboot.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

GorilaCabreado
Posts: 8
Joined: Wed Jul 17, 2019 12:47 pm
Location: Spain

Re: Destination Host Unreachable

Wed Jul 17, 2019 5:26 pm

epoch1970 wrote:
Wed Jul 17, 2019 5:21 pm
Ok.
Your dhcpcd.conf file is slightly incorrect, but since it is, I think the router has given a DHCP address to the Pi.

Reboot once more without changing anything, then try “ping 8.8.8.8”
Also post the output of “route -n”, after that reboot.

Code: Select all

[email protected]:~$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 192.168.1.33 icmp_seq=1 Destination Host Unreachable
From 192.168.1.33 icmp_seq=2 Destination Host Unreachable
From 192.168.1.33 icmp_seq=3 Destination Host Unreachable
^C
--- 8.8.8.8 ping statistics ---
4 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3003ms
pipe 3
[email protected]:~$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.0.1     0.0.0.0         UG    202    0        0 eth0
192.168.0.1     0.0.0.0         255.255.255.255 UH    202    0        0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U     202    0        0 eth0
[email protected]:~$

drgeoff
Posts: 9929
Joined: Wed Jan 25, 2012 6:39 pm

Re: Destination Host Unreachable

Wed Jul 17, 2019 5:47 pm

GorilaCabreado wrote:
Wed Jul 17, 2019 5:09 pm

Code: Select all

static ip_address= 192.168.1.39/24
static routers=192.168.1
static domain_name_servers=192.168.1
All 3 of those lines should contain a dotted quad. Only one does.

epoch1970
Posts: 3894
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Destination Host Unreachable

Wed Jul 17, 2019 5:49 pm

Unlucky... Let's remove (comment) what's in dhcpcd.conf:

Code: Select all


#interface eth0
#static ip_address= 192.168.1.39/24
#static routers=192.168.1
#static domain_name_servers=192.168.1

And reboot. Then pls. run "route -n" and "ifconfig -a", "ping -c 1 192.168.1.1" and "ping -c 1 192.168.0.1". Also "cat /etc/dhcpcd.conf" so that we can see the file in full.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

epoch1970
Posts: 3894
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Destination Host Unreachable

Wed Jul 17, 2019 5:51 pm

drgeoff wrote:
Wed Jul 17, 2019 5:47 pm
All 3 of those lines should contain a dotted quad. Only one does.
Yep. And it doesn't match the router's config I believe...
We're making progress nonetheless I hope.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

GorilaCabreado
Posts: 8
Joined: Wed Jul 17, 2019 12:47 pm
Location: Spain

Re: Destination Host Unreachable

Wed Jul 17, 2019 5:58 pm

I removed what you said from the etc/dhcpcd.conf and the rebooted.
And then what you requested

Code: Select all

[email protected]:~$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    202    0        0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U     202    0        0 eth0
[email protected]:~$ ifconfig -a
eth0      Link encap:Ethernet  HWaddr b8:27:eb:c8:be:46
          inet addr:192.168.1.33  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::d82e:e00c:bd58:4b44/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:97 errors:0 dropped:0 overruns:0 frame:0
          TX packets:67 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:7637 (7.4 KiB)  TX bytes:9013 (8.8 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:1556 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1556 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:81953 (80.0 KiB)  TX bytes:81953 (80.0 KiB)

wlan0     Link encap:Ethernet  HWaddr b8:27:eb:9d:eb:13
          inet6 addr: fe80::f59:2e93:f7f1:14da/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:19 errors:0 dropped:19 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2146 (2.0 KiB)  TX bytes:0 (0.0 B)

[email protected]:~$ ping -c 1 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.592 ms

--- 192.168.1.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.592/0.592/0.592/0.000 ms
[email protected]:~$ ping -c 192.168.0.1
Usage: ping [-aAbBdDfhLnOqrRUvV] [-c count] [-i interval] [-I interface]
            [-m mark] [-M pmtudisc_option] [-l preload] [-p pattern] [-Q tos]
            [-s packetsize] [-S sndbuf] [-t ttl] [-T timestamp_option]
            [-w deadline] [-W timeout] [hop1 ...] destination
[email protected]:~$ cat /etc/dhcpcd.conf
# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.

# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel

# Inform the DHCP server of our hostname for DDNS.
hostname

# Use the hardware address of the interface for the Client ID.
clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
#duid

# Persist interface configuration when dhcpcd exits.
persistent

# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit

# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Most distributions have NTP support.
option ntp_servers
# Respect the network MTU.
# Some interface drivers reset when changing the MTU so disabled by default.
#option interface_mtu

# A ServerID is required by RFC2131.
require dhcp_server_identifier

# Generate Stable Private IPv6 Addresses instead of hardware based ones
slaac private

# A hook script is provided to lookup the hostname if not set by the DHCP
# server, but it should not be run by default.
I really apreciate your help guys, thaks for being so patient

GorilaCabreado
Posts: 8
Joined: Wed Jul 17, 2019 12:47 pm
Location: Spain

Re: Destination Host Unreachable

Wed Jul 17, 2019 6:09 pm

To give you guys some more info, my router's configuration is:

IP: 192.168.1.1
Mask: 255.255.255.0
DHCP range: 192.168.1.33 --> 192.168.1.199
DNS servers:
80.58.61.250
80.58.61.254

I don't know if that helps at all

epoch1970
Posts: 3894
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Destination Host Unreachable

Wed Jul 17, 2019 6:17 pm

Sweet. Does "ping 8.8.8.8" work now??
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

GorilaCabreado
Posts: 8
Joined: Wed Jul 17, 2019 12:47 pm
Location: Spain

Re: Destination Host Unreachable

Wed Jul 17, 2019 6:25 pm

Je t'adore mon ami, te quiero and i love you, in three languages, it's pinging 8.8.8.8 and google as well

Code: Select all

[email protected]:~$ ping -c 1 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=54 time=3.08 ms

--- 8.8.8.8 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 3.087/3.087/3.087/0.000 ms
[email protected]:~$ ping www.google.com
PING www.google.com (172.217.168.164) 56(84) bytes of data.
64 bytes from mad07s10-in-f4.1e100.net (172.217.168.164): icmp_seq=1 ttl=54 time=3.58 ms
64 bytes from mad07s10-in-f4.1e100.net (172.217.168.164): icmp_seq=2 ttl=54 time=3.17 ms
64 bytes from mad07s10-in-f4.1e100.net (172.217.168.164): icmp_seq=3 ttl=54 time=3.50 ms
64 bytes from mad07s10-in-f4.1e100.net (172.217.168.164): icmp_seq=4 ttl=54 time=3.20 ms
64 bytes from mad07s10-in-f4.1e100.net (172.217.168.164): icmp_seq=5 ttl=54 time=3.64 ms
64 bytes from mad07s10-in-f4.1e100.net (172.217.168.164): icmp_seq=6 ttl=54 time=3.10 ms
64 bytes from mad07s10-in-f4.1e100.net (172.217.168.164): icmp_seq=7 ttl=54 time=3.50 ms
64 bytes from mad07s10-in-f4.1e100.net (172.217.168.164): icmp_seq=8 ttl=54 time=3.28 ms
64 bytes from mad07s10-in-f4.1e100.net (172.217.168.164): icmp_seq=9 ttl=54 time=3.42 ms
64 bytes from mad07s10-in-f4.1e100.net (172.217.168.164): icmp_seq=10 ttl=54 time=3.41 ms
^C
Thankyou so much :D

epoch1970
Posts: 3894
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Destination Host Unreachable

Wed Jul 17, 2019 6:37 pm

Well done! :)

Are you very much attached to that .39 address you used before? (I have no idea how the LORA stuff works)
If you are,
  • the simplest and best would be to configure your router (web interface at 192.168.1.1) and reserve the IP address of your choice, say 192.168.1.39, to the MAC address b8:27:eb:c8:be:46 (the MAC address of eth0).
    After that, reboot the Pi and if that is not enough to get the new address, stop the Pi, reboot the router and start the Pi.
  • Another way could be to re-add a static configuration in dhcpcd.conf, but as you see making errors is easy when specifying a network config by hand. Still, we could do that.
Cheers.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Return to “Beginners”