# ping at terminal and google not working on firefox; [SOLVED]

## mikefot

Dear All,

I am running gentoo stable on an FX 8350 box.

After some world updates my net connection is a bit wonky.

If I run 

```
ping www.google.co.uk
```

 I get 

```
network is unreachable
```

 as an error.

But if I run firefox I can run gmail on it successfully.

I also did 

```
emaint -a sync
```

 and did a world update and installed the latest package updates.

But I can't load google or even the gentoo forums website on firefox.

Suggestions on some diagnostics I could run would be appreciated.

Regards

Michael FothergillLast edited by mikefot on Fri Oct 16, 2020 10:03 am; edited 1 time in total

----------

## The Doctor

Okay, this is a total shot in the dark and probably shouldn't be a first response, but....

I think your DNS is messed up. The working stuff knows the IP address so it isn't a problem but if it has to resolve the IP address your SOL. To test my hypothesis try ping -c1 89.16.167.134 and let us know what that does.

If it works (or doesn't) try editing /etc/resolv.conf. Make the only uncommitted entry nameserver 8.8.8.8 See if google will solve your problem. It is easy to make this permanent if it works.

At the very least the above will narrow the problem space. If that doesn't doesn't yield any fruit please post what got updated. You can find the information in /var/log/emerge.log

[Moderator edit: added 1 to the ping command to make it valid, in case a future reader tries the advice.  The edit came too late for the OP. -Hu]

----------

## Juippisi

IP4 vs. IP6?

----------

## mikefot

Many thanks for the response.

I ran 

```
ping -c 89.16.167.134
```

The response was 

```
ping: invalid argument: '89.16.167.134'
```

I edited the 

```
/etc/resolv.conf 
```

file and commented out the two nameserver entries.

I then added an extra one: 

```
nameserver 8.8.8.8
```

.

When I tried 

```
ping -c 89.16.167.134
```

 again I got the same invalid argument error as before.

Comments appreciated.

PS How do I tell if I am using IP4 or IP6?

Cheers

MF

PPS  I looked at the 

```
emerge.log
```

 output.  Nothing new seemed to appear in it that I could see from the last thing I did the other day.

----------

## freke

 *mikefot wrote:*   

> Many thanks for the response.
> 
> I ran 
> 
> ```
> ...

 

```
ping -c 10 89.16.167.134
```

```
       -c count

           Stop after sending count ECHO_REQUEST packets. With deadline option, ping waits for count ECHO_REPLY packets, until the timeout expires.
```

ie. the -c needs a number of pings you want to perform.

----------

## mikefot

Many thanks for your response and suggestion.

I tried adding in a count number but I still get the error

```
 ping: connect: Network is unreachable
```

.

Comments appreciated.

Regards

MF

----------

## Hu

Please show the output of dig www.google.co.uk ; ip route.

----------

## mikefot

Many thanks for your advice.

The output from dig is here:

```
➜  mikef dig www.google.co.uk ; ip route

; <<>> DiG 9.16.6 <<>> www.google.co.uk

;; global options: +cmd

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 10230

;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:

;www.google.co.uk.              IN      A

;; ANSWER SECTION:

www.google.co.uk.       60      IN      A       216.239.38.120

;; Query time: 22 msec

;; SERVER: fdee:615d:e88b:0:a2bd:cdff:fe72:2000#53(fdee:615d:e88b:0:a2bd:cdff:fe72:2000)

;; WHEN: Sat Oct 10 17:23:01 BST 2020

;; MSG SIZE  rcvd: 50

➜  mikef
```

Comments appreciated

Regards

MF

----------

## Hu

I asked also for ip route.  I see in your paste that you tried to run it, but somehow its output is not present.  Please run it freestanding and post its output as well.

----------

## mikefot

Many thanks again.

I tried running 

```
netstat -r 
```

and

```
 ip route
```

:

```
➜  mikef netstat -r

Kernel IP routing table

Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface

➜  mikef ip route

➜  mikef
```

I don't seem to get much output from either command.

Suggestions welcome.

Regards

MF

PS

I ran a few extra commands:

```
➜  mikef ip addr

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000

   link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

   inet 127.0.0.1/8 brd 127.255.255.255 scope host lo

      valid_lft forever preferred_lft forever

   inet6 ::1/128 scope host  

      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 54:a0:50:d5:11:f8 brd ff:ff:ff:ff:ff:ff

   inet6 2a02:c7d:a18f:dc00:56a0:50ff:fed5:11f8/64 scope global dynamic mngtmpaddr  

      valid_lft 6113sec preferred_lft 2510sec

   inet6 fdee:615d:e88b:0:56a0:50ff:fed5:11f8/64 scope global dynamic mngtmpaddr  

      valid_lft forever preferred_lft forever

   inet6 fe80::56a0:50ff:fed5:11f8/64 scope link  

      valid_lft forever preferred_lft forever

3: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000

   link/sit 0.0.0.0 brd 0.0.0.0

➜  mikef 

➜  mikef ifconfig -a

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

       inet6 fe80::56a0:50ff:fed5:11f8  prefixlen 64  scopeid 0x20<link>

       inet6 2a02:c7d:a18f:dc00:56a0:50ff:fed5:11f8  prefixlen 64  scopeid 0x0<global>

       inet6 fdee:615d:e88b:0:56a0:50ff:fed5:11f8  prefixlen 64  scopeid 0x0<global>

       ether 54:a0:50:d5:11:f8  txqueuelen 1000  (Ethernet)

       RX packets 37565  bytes 11498260 (10.9 MiB)

       RX errors 0  dropped 13366  overruns 0  frame 0

       TX packets 14658  bytes 2377059 (2.2 MiB)

       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 2  bytes 78 (78.0 B)

       RX errors 0  dropped 0  overruns 0  frame 0

       TX packets 2  bytes 78 (78.0 B)

       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

sit0: flags=128<NOARP>  mtu 1480

       sit  txqueuelen 1000  (IPv6-in-IPv4)

       RX packets 0  bytes 0 (0.0 B)

       RX errors 0  dropped 0  overruns 0  frame 0

       TX packets 0  bytes 0 (0.0 B)

       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

➜  mikef

```

PS I am using 

```
zsh
```

----------

## Hu

I see.  You didn't drop the output the first time.  There just was no output to show.  I did not even consider that possibility, because it is extremely rare, especially in the presence of any working network resources.  You should always have at least a few routes.  If you don't, networking in general will not work well.

Based on your other output, you have no IPv4 address, which explains the lack of IPv4 routes.  The resources that work are probably served over IPv6.  So the question then becomes, why do you not have an IPv4 address?  If your system were in working order, how would you expect it to get an IPv4 address?  NetworkManager?  DHCPCD?  Something else?

----------

## NeddySeagoon

mikefot,

A few things.

That firefox works but ping www.google.co.uk fails shows that you have a nameserver issue.

Firefox uses its own DNSSec nameservers if it can reach them, not the ones you have in /etc/resolv.conf.

That may well be a privacy issue, since Mozilla knows all the websites you visit, rather than your ISP, or as well as your ISP.

Anyway that's a free extra. 

```
ping -c 89.16.167.134
```

 is incorrect. -c expects a value for the number of pings to send. If -cX is omitted, its ping forever.

The IP is not a valid argument to the -c option.

```
nameserver 8.8.8.8

ping 89.16.167.134
```

are all using IPv4 addresses.

IPv6 addresses look like fe80::2e0:4cff:fe69:1509

All the public IPv6 addresses begin with a 2

----------

## mikefot

Many thanks for your help again.

Firefox was working fine until I did a recent world update.

I read the 

```
eread news
```

 updates and I think there was an instruction in there to run 

an emerge command recommended to deal with the supposed retiring of 

```
python 2.7 
```

if I recall it correctly.

I noticed during the most recent world update and

```
 perl-cleaner
```

 run that some of the 

```
python 2.7
```

 may still

be around plus some other deprecated stuff I need to get rid of.

Maybe that has got something to do with  this problem appearing.

Regards

MF

----------

## NeddySeagoon

mikefot,

Pyton:2.7 will be around for a while yet. Some big packages need it for their build systems.

--depclean will remove python:2.7 when you don't need it unless you force keeing around with world file pollution or /etc/portage/* entries.

Your 

```
mikef ifconfig -a
```

shows that you have an IPv6 public IP but no IPv4 address at all.

This means that IPv6 might work but that IPv4 cannot. Not everything on the internet supports IPv6 yet, so you have lost at least the IPv4 only internet.

The question now becomes how do you get your IPv4 setup?

If you didn't do anything special, it will be dhcp.

What does 

```
dhcpcd eth0
```

have to say?

When you get the prompt back, what does 

```
ifconfig eth0
```

show?

IPv6 and IPv4 are almost completely separate, other than using the same wires.

----------

## mikefot

Many thanks for your advice.

I ran 

```
dhcpcd eth0
```

 a couple of times.  It doesn't generate much output.

I also ran 

```
ifconfig eth0
```

 as well:

```
➜  mikef dhcpcd eth0

sending commands to master dhcpcd process

➜  mikef dhcpcd eth0

sending commands to master dhcpcd process

➜  mikef ifconfig eth0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

       inet6 fdee:615d:e88b:0:56a0:50ff:fed5:11f8  prefixlen 64  scopeid 0x0<global>

       inet6 fe80::56a0:50ff:fed5:11f8  prefixlen 64  scopeid 0x20<link>

       inet6 2a02:c7d:a18f:dc00:56a0:50ff:fed5:11f8  prefixlen 64  scopeid 0x0<global

       ether 54:a0:50:d5:11:f8  txqueuelen 1000  (Ethernet)

       RX packets 195  bytes 24989 (24.4 KiB)

       RX errors 0  dropped 149  overruns 0  frame 0

       TX packets 11  bytes 930 (930.0 B)

       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

➜  mikef
```

Comments appreciated.

Regards

MF

PS Would this command help at all:

```
 touch /etc/udev/rules.d/80-net-name-slot.rules
```

 ?

PPS I have googled around to look for other cases where people had this kind of problem.  

Possible causes were incorrect system time.  Releasing and reinstating the IP address was another remedial suggestion.

PPPS

Here is a bit more output:

```
mikef ip -4 -c -o address

1: lo    inet 127.0.0.1/8 brd 127.255.255.255 scope host lo\       valid_lft forever preferred_lft for

ever
```

----------

## mikefot

The problem has cured itself somehow.

Regards

MF

----------

