# Can't ping servers nor access them

## dragonfire2003

Pretty straight forward, Finished installing Gentoo and when I run (for example) ping google.com this shows up:

```

ping: google.com: Temporary failure in name resolution

```

I'm using the binary kernel and I'm using an Ethernet cable

Kernel Version: 5.10.102

no DE

----------

## Hu

Please post the output of id ; namei -l /etc/resolv.conf ; cat -n /etc/resolv.conf, as run in a shell where ping fails as shown.

----------

## pietinger

Do you use netifrc or networkmanager ? Please show us your /etc/resolv.conf

Does a ping to 8.8.8.8 work ? If yes, it is "only" the name resolution ... do you know the ip address of your router ? (usually all home routers have a dns server so you can set it inyour resolv.conf to it)

----------

## dragonfire2003

 *Hu wrote:*   

> Please post the output of id ; namei -l /etc/resolv.conf ; cat -n /etc/resolv.conf, as run in a shell where ping fails as shown.

 

output of namei -l /etc/resolv.comf

```

drwxr-xr-x root root /

drwxr-xr-x root root etc

-rw-r--r-- root root resolv.conf

```

output of cat -n /etc/resolv.conf

```

# Generated by dhcpcd from enp7s0.dhcp

# /etc/resolv.conf.head can replace this line

domain domain.name

nameserver 192.168.0.1

# /etc/resolv.conf.tail can replace this line

```

----------

## dragonfire2003

 *pietinger wrote:*   

> Do you use netifrc or networkmanager ? Please show us your /etc/resolv.conf
> 
> Does a ping to 8.8.8.8 work ? If yes, it is "only" the name resolution ... do you know the ip address of your router ? (usually all home routers have a dns server so you can set it inyour resolv.conf to it)

 

A ping to 8.8.8.8 doesnt work but a ping to 127.0.0.1 works

----------

## pietinger

 *dragonfire2003 wrote:*   

> A ping to 8.8.8.8 doesnt work but a ping to 127.0.0.1 works

 

127.0.0.1 is your own station (it should work always). If a ping to 8.8.8.8 doesnt work then you are OFFLINE ... the question is only:

1. to your router, or

2. your router to network ?

Its simple: Ping your router (192.168.0.1). If this doesnt work, then your cable to router is a problem or you have no network modules. This you can check with:

```
# lspci -k
```

You should find your ethernet adapter WITH module = kernel driver in use. Example from my station:

```
 05:00.0 Ethernet controller: Qualcomm Atheros Killer E2500 Gigabit Ethernet Controller (rev 10)

        Subsystem: Gigabyte Technology Co., Ltd Killer E2500 Gigabit Ethernet Controller

        Kernel driver in use: alx
```

If you have this, then check IF 192.168.0.1 is really your router ip address. Maybe its 192.168.1.1 ...  :Wink: 

----------

## dragonfire2003

 *pietinger wrote:*   

>  *dragonfire2003 wrote:*   A ping to 8.8.8.8 doesnt work but a ping to 127.0.0.1 works 
> 
> 127.0.0.1 is your own station (it should work always). If a ping to 8.8.8.8 doesnt work then you are OFFLINE ... the question is only:
> 
> 1. to your router, or
> ...

 

I have that, Will check if 192.168.0.1 is my router ip

edit: when i try to ping both, this shows up

```

ping: connect: Network is unreachable

```

Last edited by dragonfire2003 on Thu Mar 17, 2022 11:45 pm; edited 1 time in total

----------

## pietinger

 *dragonfire2003 wrote:*   

> I dont have that, How do I install a network module? (Sorry if this sounds dumb, From all the distros I have used in the past this wasn't a problem)

 

To answer this I have to know HOW you did your kernel installation, because ethernet modules are in kernel (or will be loaded later).

You can check: Boot again with you minimal CD and check which module is shown then. This you will need. And then it depends HOW you did your installation. (with genkernel or manually; systemd or OpenRC; ifrc or networkmanager, etc..)

----------

## dragonfire2003

 *pietinger wrote:*   

>  *dragonfire2003 wrote:*   I dont have that, How do I install a network module? (Sorry if this sounds dumb, From all the distros I have used in the past this wasn't a problem) 
> 
> To answer this I have to know HOW you did your kernel installation, because ethernet modules are in kernel (or will be loaded later).
> 
> You can check: Boot again with you minimal CD and check which module is shown then. This you will need. And then it depends HOW you did your installation. (with genkernel or manually; systemd or OpenRC; ifrc or networkmanager, etc..)

 

I edited the original message

and also, when I boot Gentoo it shows

```

ERROR: net.eth0 failed to start

ERROR: cannot start netmount as net.eth0 would not start

```

I'm pretty sure that's related...

----------

## pietinger

 *dragonfire2003 wrote:*   

> I'm pretty sure that's related...

 

YES  :Wink: 

Now we have to check WHY. Look into your systemlog with "dmesg" and check if you see something there. Check also the output of "ip a".

For more help we rally need more informations, especially  your network configuration: NETIFRC or networkmanager ?

(see more here: https://wiki.gentoo.org/wiki/Network_management and https://wiki.gentoo.org/wiki/Netifrc)

Do you use DHCP ?

systemd or OpenRC ?

This is a must know because it makes no sense if I tell you you should do an "rc-update" on a systemd system.

----------

## dragonfire2003

 *pietinger wrote:*   

>  *dragonfire2003 wrote:*   I'm pretty sure that's related... 
> 
> YES 
> 
> Now we have to check WHY. Look into your systemlog with "dmesg" and check if you see something there. Check also the output of "ip a".
> ...

 

dmesg output

(Had to be an image, Too big for me too type everything)

https://cdn-129.anonfiles.com/J77fX8O3x1/a97a9bfe-1647564886/IMG_20220317_214251.jpg

ip a output

```

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 0: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: enp7s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000

link/ether 3c:7c:3f:7a:c4:0f brd ff:ff:ff:ff:ff:ff

```

No, I dont use DHCP

I use OpenRC

----------

## pietinger

Ok, you have a problem with your nvidia; this we do later. Also a problem with your /etc/fstab; probably a FAT (for UEFI), but you try to mount it as ext4; but also not a problem right now.

In this output is nothing about your ethernet. I assume you have just a wrong network configuration.

Do you use netifrc ? (this is NOT OpenRC; have you looked into the links I gave you ?) Or other way to ask:

What have you done when you were at this point of installation ? => https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/System#Network

Do you have a static ip address ? If yes, what is the contect of /etc/conf.d/net ?

Dont try to start both: netifrc AND networkmanager. Check with "rc-update" and look which are started.

----------

## pietinger

Just a guess: Do have linked net.eth0 instead of your ethernet adapter which is named: "enp7s0". If so, then remove the old ones and take "enp7s0" instead of "eth0".

----------

## pietinger

I am sorry, but I have to leave now. I am sure @Hu (or anybody else) will help you also.

Please open a new post for your nvidia problem (later).

----------

## dragonfire2003

 *pietinger wrote:*   

> Just a guess: Do have linked net.eth0 instead of your ethernet adapter which is named: "enp7s0". If so, then remove the old ones and take "enp7s0" instead of "eth0".

 

]

my etc/conf.d/net file:

```

config_eth0="192.168.0.2 netmask 255.255.255.0 brd 192.168.0,255

routes_eth0="default via 192.168.0.1"

```

I don't have netifrc 

 *pietinger wrote:*   

> What have you done when you were at this point of installation ? => https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/System#Network 

 

I followed everything but the DHCP part

Also thanks for telling me about the fstab and the nvidia problems, for the fstab one I changed /dev/sda1 to fat as for the NVIDIA one I dont really care much cus all I need is a working DE for now, I already ordered an AMD GPU...

rc-update output:

way too big for me to type

https://cdn-145.anonfiles.com/R5K9X2Oax0/09d0514d-1647567225/IMG_20220317_222207.jpg

----------

## pietinger

 *dragonfire2003 wrote:*   

> my etc/conf.d/net file:
> 
> ```
> config_eth0="192.168.0.2 netmask 255.255.255.0 brd 192.168.0,255
> 
> ...

 

Ok - you have netifrc  :Wink: 

Change this to - Attention there is a DOT in brd 192.168.0.255:

```
config_enp7s0="192.168.0.2 netmask 255.255.255.0 brd 192.168.0.255

routes_enp7s0="default via 192.168.0.1"
```

Then do this:

```
# cd /etc/init.d

# rc-update del net.eth0 default

# rm net.eth0

# ln -s net.lo net.enp7s0

# rc-update add net.enp7s0 default
```

After a reboot you should be online.

----------

## grknight

 *pietinger wrote:*   

> 
> 
> ```
> config_enp7s0="192.168.0.2 netmask 255.255.255.0 brd 192.168.0.255
> 
> ...

 

I would recommend this instead.. for simplicity and fixing a typo:

```
config_enp7s0="192.168.0.2/24"

routes_enp7s0="default via 192.168.0.1"
```

Internally, netifrc will convert netmask and brd to CIDR (the /24) anyway so providing it skips a step.

----------

## pietinger

 *grknight wrote:*   

> I would recommend this instead.. 

 

Yes, that is easier (and I know it); the only reason was: I dont want to confuse OP any more. BTW: I think, OP hasnt read in our AMD64-handbook this NOTE:

 *Quote:*   

> This assumes that the network interface will be called eth0. This is, however, very system dependent.  [...]

 

Maybe it should be a WARNING instead a simple NOTE ...

----------

