0

All of the sudden for no reason my raspberry stop access to the internet. I have reinstalled the OS and no help. Connect to the WiFi lan but does not connect and returns an error when wire line to a local switch. It only access the internet from a wireless connection.

The wireless router is other that the one in the wire lan in the building. What confuses me is that I have 2 computers running from the same switch connected to the Pi. But the other desktop computers are resolving.

Here is a ipconfog with Wireless and with wire connection

pi@raspberrypi:~ $ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 136.145.61.82  netmask 255.255.255.0  broadcast 136.145.61.255
        inet6 fe80::c11e:7b12:97a9:1b4f  prefixlen 64  scopeid 0x20<link>
        ether b8:27:eb:14:06:02  txqueuelen 1000  (Ethernet)
        RX packets 1422  bytes 143386 (140.0 KiB)
        RX errors 0  dropped 1  overruns 0  frame 0
        TX packets 94  bytes 13445 (13.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 568  bytes 48440 (47.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 568  bytes 48440 (47.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

pi@raspberrypi:~ $ ifconfig
eth0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether b8:27:eb:14:06:02  txqueuelen 1000  (Ethernet)
        RX packets 1683  bytes 169984 (166.0 KiB)
        RX errors 0  dropped 1  overruns 0  frame 0
        TX packets 101  bytes 14527 (14.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 644  bytes 54664 (53.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 644  bytes 54664 (53.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.31.2.238  netmask 255.255.0.0  broadcast 10.31.255.255
        inet6 fe80::bc2e:4dd1:5b0f:b371  prefixlen 64  scopeid 0x20<link>
        ether b8:27:eb:41:53:57  txqueuelen 1000  (Ethernet)
        RX packets 10941  bytes 4435890 (4.2 MiB)
        RX errors 0  dropped 1  overruns 0  frame 0
        TX packets 1390  bytes 255159 (249.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

pi@raspberrypi:~ $ 

UPDATE:

Following comment request

  GNU nano 2.7.4                 File: /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

UPDATE 2

Ping with the Wirelesss connection

pi@raspberrypi:~ $ ping 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=109 time=40.3 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=109 time=41.3 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=109 time=48.1 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=109 time=43.7 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=109 time=38.3 ms
64 bytes from 8.8.8.8: icmp_seq=6 ttl=109 time=39.6 ms
64 bytes from 8.8.8.8: icmp_seq=7 ttl=109 time=43.2 ms
64 bytes from 8.8.8.8: icmp_seq=8 ttl=109 time=38.6 ms

With the Wire connection

pi@raspberrypi:~ $ ping 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=107 time=36.5 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=107 time=36.8 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=107 time=36.4 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=107 time=36.4 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=107 time=36.4 ms
64 bytes from 8.8.8.8: icmp_seq=6 ttl=107 time=36.5 ms
64 bytes from 8.8.8.8: icmp_seq=7 ttl=107 time=36.4 ms

UPDATE 3

Here is a ping to google with wire

pi@raspberrypi:~ $ ping google.com
ping: google.com: Temporary failure in name resolution

Here is a ping to google with Wireless

 PING google.com (172.217.8.142) 56(84) bytes of data.
    64 bytes from mia07s49-in-f14.1e100.net (172.217.8.142): icmp_seq=1 ttl=40 time=43.3 ms
    64 bytes from mia07s49-in-f14.1e100.net (172.217.8.142): icmp_seq=2 ttl=40 time=46.8 ms
    64 bytes from mia07s49-in-f14.1e100.net (172.217.8.142): icmp_seq=3 ttl=40 time=36.9 ms
  • can you ping an internet address by IP? like 8.8.8.8 (One of googles servers)? Name_Resuolution is probably a DNS error of some sort, should update your question with the contents of /etc/network/interfaces and /etc/resolve.conf – Chad G Apr 29 at 16:18
  • HOw is this done? What is the Command line? – Jose Enrique Calderon Apr 29 at 16:18
  • 1
    $ ping 8.8.8.8 is the command to ping address, or $ ping www.google.com will ping a name. then you can $ cat /etc/network/interfaces, $cat /etc/resolve.conf – Chad G Apr 29 at 16:21
  • @ChadG I have added the ping resolution with wireless connection and a Wire connection – Jose Enrique Calderon Apr 29 at 17:01
1

The problem is definitely with DNS name resolution. You can ping ip addresses on the internet but not when using names like google.com. The translation from a name into an ip address is not working when connected wired.

Name resolution is made by DNS name server. There are an endless amount of DNS server running on the internet. You need to know the ip address of at least one DNS server for name resolution. If you connect to your internet router either wired with help of a switch or direct wireless you will get an ip address for the RasPi (e.g. 136.145.61.82 or 10.31.2.238) from a DHCP server running on the internet router. The DHCP server also transmits the ip address of a DNS server that the RasPi should use. The RasPi stores the ip address(es) of the DNS server to use in the file /etc/resolv.conf. You can always check if you have got a DNS server with cat /etc/resolv.conf.

Usually you do not have to worry about all of this because the operating system does manage this for you. But in your case it seems that with the wired connection there is no DNS server ip address transmitted to the RasPi. Check it.

There is another issue with your wired connection. The wired interface eth0 has got a public ip address 136.145.61.82 from the DHCP server used for direct communication on the internet by provider. This is very unusual, particularly when you get a private ip address 10.31.2.238 from the DHCP server for the wireless connection. I would expect that you also get an ip address 10.31.x.x for eth0.

Because lack of further information I can only advise to check your wired connection why it does not give you a private ip address and if it is OK. Also check what may be wrong with the configuration on the internet router (configuration of the DHCP server?) why it doesn't send a DNS server ip address. All in all it seems that the switch for the wired connection is not connected to the same internet router that also provided the wireless connection. You confirmed this in a comment.

There are other computers on the same switch that are running. Connect the RasPi for testing on the connection of a working computer and look if it also works.

Update 2019-05-22:
You asked for a ping 136.145.61.82. The host does not reply to ping but it is up as you can check with nmap:

~$ sudo nmap -Pn 136.145.61.82

Starting Nmap 7.40 ( https://nmap.org ) at 2019-05-22 13:22 CEST
Nmap scan report for 136.145.61.82
Host is up (0.015s latency).
Not shown: 998 filtered ports
PORT    STATE  SERVICE
25/tcp  closed smtp
113/tcp closed ident

Nmap done: 1 IP address (1 host up) scanned in 14.75 seconds
  • Thank you for details explanation. This is very unusual since I have 2 other computers in my lab connected to a building server. The wireless connection has an origin from a remote location not related to the sire service router. – Jose Enrique Calderon Apr 29 at 19:24
  • @JoseEnriqueCalderon That means you are connecting to different internet router. The wired connection uses another router than the wireless connection. Can you please confirm this? – Ingo Apr 29 at 19:31
  • Correct. The wireless router is other that the one in the wire lan in the building. What confuses me is that I have 2 computers running from the same switch connected to the Pi. But the other desktop computers are resolving. – Jose Enrique Calderon Apr 29 at 20:57
  • @JoseEnriqueCalderon I have updated the answer in the last paragraph. – Ingo Apr 29 at 21:19
  • Very unusual indeed. I have modified my ethernet file to set this public ip and worked. I have been asking about this to the IT administrator but is new and have little know how on the dhcp configurations on our server side. Please, ping the address and check for a reply? – Jose Enrique Calderon May 22 at 9:01

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.