User avatar
cotti
Posts: 3
Joined: Tue Oct 02, 2012 5:45 pm
Location: Belo Horizonte - BR
Contact: Website

Only graphical applications can connect to the Internet. Nothing using CLI can.

Sun Aug 13, 2017 12:32 am

So, yeah, this is driving me mad. Tried the whole day to find something, to no avail.

I decided to do something else with my Pi3, so I put up the Netinstaller, and got Raspbian Lite.

The installation works fine, it downloaded the distro, and all that jazz. Reboot, and can't use anything that uses the internet. Looked at ifconfig, there it is, up and running. Got an IP, it's not conflicting on the router table. iwconfig shows that it's connected to the same network. But nothing, absolutely nothing worked. Pings always give "n packets transmitted, 0 received, 100% packet loss". A traceroute to the same path (let's say, google.com) shows that up until halfway it goes fine, but nothing comes back.

I tried reinstalling from scratch but it didn't work. Then I thought, "maybe it's something weird on Lite, I'll try the regular Raspbian". Installed it and... no connection on the terminal. But then I went to the GUI, and if I open Chromium, or even the main Add/Remove programs window, it works fine. I can open a LXTerminal and a Chromium window side-by-side and one will present the webpage and the other won't be able to ping the same address.

I tried connecting both through wifi and cable, and they present the same result. I looked into anything weird that could've gotten in config files, but didn't catch anything. Just what is going on? What could even be an useful log to add, since... Technically the connections ARE working, but... just for GUI applications?
"Absurdity is the only reality." ~ZAPPA, Frank

User avatar
topguy
Posts: 5626
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Only graphical applications can connect to the Internet. Nothing using CLI can.

Sun Aug 13, 2017 1:10 pm

Lot of description but little actual facts we can relate to.
How about posting actual result from "ip addr" command. Or your exact ping examples with results.

A lot of web-servers dont answer to ping. If you can run "sudo apt-get update" without errors you have working internet.

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

Re: Only graphical applications can connect to the Internet. Nothing using CLI can.

Sun Aug 13, 2017 1:20 pm

I wonder if there's some proxy server or something getting in the way and the Chromium is getting the settings automatically?

Or DNS and http/https is working, but ping is blocked.

User avatar
cotti
Posts: 3
Joined: Tue Oct 02, 2012 5:45 pm
Location: Belo Horizonte - BR
Contact: Website

Re: Only graphical applications can connect to the Internet. Nothing using CLI can.

Sun Aug 13, 2017 1:49 pm

topguy wrote:
Sun Aug 13, 2017 1:10 pm
Lot of description but little actual facts we can relate to.
How about posting actual result from "ip addr" command. Or your exact ping examples with results.

A lot of web-servers dont answer to ping. If you can run "sudo apt-get update" without errors you have working internet.
Sure thing. As I actually wrote, I just wasn't sure of what would be useful to add since everything seems so normal, and it's a completely vanilla installation. Here's my ip addr:

Code: Select all

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:51:b0:ef brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.16/24 brd 192.168.0.255 scope global eth0
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether b8:27:eb:04:e5:ba brd ff:ff:ff:ff:ff:ff
As a note, wlan0 is disabled through ifdown on purpose, since I tried connecting it directly through eth0 but had the same results.

Pinging www.google.com just hangs, so I have to Ctrl+C to get results.

Code: Select all

PING www.google.com (216.58.202.196) 56(84) bytes of data.
♥
--- www.google.com ping statistics ---
8 packets transmitted, 0 received, 100% packet loss, time 7259ms
Here's the traceroute for it.

Code: Select all

traceroute to www.google.com (216.58.202.196), 30 hops max, 60 byte packets
 1  192.168.0.1 (192.168.0.1)  0.737 ms  1.046 ms  1.322 ms
 2  10.66.128.1 (10.66.128.1)  9.725 ms  9.928 ms  9.882 ms
 3  c91180fe.virtua.com.br (201.17.128.254)  12.387 ms  12.327 ms  15.495 ms
 4  c91180fd.virtua.com.br (201.17.128.253)  16.106 ms  16.047 ms  16.143 ms
 5  embratel-T0-5-2-0-tacc01.bhe.embratel.net.br (200.255.9.1)  16.084 ms  16.535 ms  16.478 ms
 6  ebt-H0-10-0-0-tcore01.bhe.embratel.net.br (200.244.213.123)  22.276 ms  19.458 ms  17.677 ms
 7  ebt-B10831-tcore01.spoph.embratel.net.br (200.244.212.126)  20.167 ms  20.122 ms  20.275 ms
 8  ebt-B1081-tcore01.spomb.embratel.net.br (200.244.212.26)  20.219 ms  20.359 ms  20.303 ms
 9  ebt-B11711-puacc01.spolp.embratel.net.br (200.244.213.176)  17.190 ms  17.472 ms  18.676 ms
10  209.85.173.92 (209.85.173.92)  131.072 ms  131.013 ms  131.344 ms
11  108.170.245.161 (108.170.245.161)  129.273 ms  129.403 ms  129.156 ms
12  72.14.239.25 (72.14.239.25)  127.556 ms  127.824 ms  127.766 ms
13  * * *
14  * * *
15  * * *
16  * * *
17  * * *
18  * * *
19  * * *
20  * * *
21  * * *
22  * * *
23  * * *
24  * * *
25  * * *
26  * * *
27  * * *
28  * * *
29  * * *
30  * * *
As it seems, I can't receive packets back. So I can't use apt-get either... Through the CLI.

Because apparently I can use the Add/Remove Software application in the GUI.

If you have any specific config files of interest, I can put them here.
rpdom wrote:
Sun Aug 13, 2017 1:20 pm
I wonder if there's some proxy server or something getting in the way and the Chromium is getting the settings automatically?

Or DNS and http/https is working, but ping is blocked.
That's why it is so weird. Add/Remove Software works too. I'll try adding other GUI software that uses the Internet to replicate it happening.

I don't have any troubles with any other devices in the network, including GNU/Linux systems both in hardware and VM. No IP conflicts in the router either.

Edit:
Tried installing some stuff. Firefox works, Midori works, Hotot (a Twitter client) works.
It just won't let me use CLI, I guess.
"Absurdity is the only reality." ~ZAPPA, Frank

User avatar
topguy
Posts: 5626
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Only graphical applications can connect to the Internet. Nothing using CLI can.

Sun Aug 13, 2017 5:16 pm

Your internet is obvoiusly working OK.

Maybe google just blocks pings from Brazil or some router that your traffic goes through is misconfigured. Maybe ping a brazilian server ?
Pinging is not really a reliable way to check internet connection. A web-browser dont use "ping" for anything, its an (out)dated protocol that is often used for DDOS attacks so I would guess it is regularely filtered.

Martin Frezman
Posts: 1020
Joined: Mon Oct 31, 2016 10:05 am

Re: Only graphical applications can connect to the Internet. Nothing using CLI can.

Sun Aug 13, 2017 6:04 pm

Well, I don't know about that - it seems to be the usual forum-here-and-there routine - but it is true that it would be nice if the OP could test something other than ping at the command line. It seems he is using ping as the sole representative of "it doesn't work" on the command line.

lynx (which is installed by default, I think - if not, just apt-get it) is an obvious choice.

netcat (sometimes installed as nc or nc6) is another possibility.
If this post appears in the wrong forums category, my apologies.

User avatar
elkberry
Posts: 167
Joined: Wed Dec 28, 2016 9:21 pm

Re: Only graphical applications can connect to the Internet. Nothing using CLI can.

Sun Aug 13, 2017 7:33 pm

topguy wrote:
Sun Aug 13, 2017 5:16 pm
Pinging is not really a reliable way to check internet connection. A web-browser dont use "ping" for anything, its an (out)dated protocol that is often used for DDOS attacks so I would guess it is regularely filtered.
Yeah. Sure. It's so outdated that Google's Android uses it to see if a network it connects to is deemed working. In other news the Earth is flat. Oh, and NAT is a safety precaution against ping and DDOS.
From ZX81 to Raspberry Pi, but wait ... where's the 7805 gone?

User avatar
elkberry
Posts: 167
Joined: Wed Dec 28, 2016 9:21 pm

Re: Only graphical applications can connect to the Internet. Nothing using CLI can.

Sun Aug 13, 2017 8:46 pm

In the tracerout output I notice what looks like CGN, or Carrier Grade NAT. The first NAT is in the home router, but then there's an intermediate network 10.x.x.x that also uses private addresses. And this is the second MAT; it maps multiple subscribers to the same single IPv4 address.

Typically this is used either in mobile networks or crippled IPv4 connectivity when there's full IPv6 enabled. But since this is a 10.x.x.x, could this be a mobile link, per chance? In this case there are forced proxies in the middle, the famous blavk boxes, that cause more problems than they seem to be worth; the boxes everyone in the IETF hates more or less.
From ZX81 to Raspberry Pi, but wait ... where's the 7805 gone?

User avatar
topguy
Posts: 5626
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Only graphical applications can connect to the Internet. Nothing using CLI can.

Sun Aug 13, 2017 8:50 pm

elkberry wrote:
Sun Aug 13, 2017 7:33 pm
Yeah. Sure. It's so outdated that Google's Android uses it to see if a network it connects to is deemed working.
Yeah, and its a pain in the ass when you connect to a private APN because the unit restarts its modem repeatedly. A lot of company networks blocks certain outgoing ICMP packets so I would assume Android also have a fallback to use TCP connects to google servers when ping fails.

My (intented) main point was that a missing ping is usually never critical for anyones internet-connection since most applications use TCP/UDP to talk to the internet.

Return to “Troubleshooting”