# [SOLVED] Ethernet connection stopped working after replug.

## Arcenturion

Hello, I installed Gentoo two days ago with KDE as my DE, along with an Internet connection that worked. However, when I decided to unplug the Ethernet cable in order to configure a wireless connection, I still have a lost connection even with the Ethernet cable plugged in. My Gentoo computer is a Thinkpad T61 model (using e1000e), and I installed wpa_supplicant and wicd, but

ping google.com returns:

ping:unknown host google.com

ifconfig lo returns:

```
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536

                    inet 127.0.0.1  netmask 255.0.0.0

                    loop txqueuelen 0 (Local loopback)

                    RX packets 433 bytes 29594 (28.9 KiB)

                    RC errors 0 dropped 0 overruns 0 frame 0

                    TX packets 433 bytes 29594 (28.9 KiB)

                    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

```

I'm aware that wpa_supplicant and wicd conflicts with NetworkManager, so I turned the daemons of the former two off.

My /etc/conf.d/net is :

```

modules=( "dhcpcd" )

config_enp0s25=( "dhcp" )

config_lo=( "dhcp" )

dns_servers_lo=( "8.8.8.8 8.8.4.4" )

dns_servers_lo=( "192.168.1.1" )
```

By the way, how do you post logs without having to type it out by hand, especially when the logs are from another computer without an internet connection? Sorry, I'm still a huge n00b to Linux.

A big thank you to everyone who'll respond!Last edited by Arcenturion on Wed Apr 24, 2013 6:04 pm; edited 1 time in total

----------

## krinn

I'm not sure if you speak about that, but the card configuration is done by openrc at coldplug (when computer boot with the cable in).

If you want unplug/plug and going (hotplug) you need ifplugd or other deamon to detect cable state, and it should run the network init when detect.

Else you plug the cable and run dhcpcd by hands.

showing ifconfig lo is just showing lo is configure, something that should be done in all case, so not informative.

you better show ifconfig -a that would gave better infos.

Your ping: unknown host google.com is just common error message for mis configured dns, so base on that, i would say you just have a dns problem (i know you have configure it in net file, but still, it is. If you have a problem with IP you would have get a "network unreashable" kind of error, or packet loss 100% for wrong routing. This might happen if you dhcpcd the interface by hands without giving to dhcpcd the correct dns to use.

And to post logs without internet, you just need to copy that log into the other computer. If you don't have network, you can put it in an usb key or other device.

And if you need to post something that is not logs, like your ifconfig -a output, you just need to send the output to a file.

```
ifconfig -a > myifconfig
```

Now myifconfig should be treat like a log, and you could apply what i have said upper, you can 

```
cat myifconfig
```

 to check its content.

----------

## khayyam

 *Arcenturion wrote:*   

> ifconfig lo returns:

 

Arcenturion ... unfortunately that tells us very little, the 'lo' (loopback) is always runing, its the interface used for TCP/IP connections locally ... and btw, it can't aquire an address via dhcp.

 *Arcenturion wrote:*   

> 
> 
> ```
> modules=( "dhcpcd" )
> 
> ...

 

A number of issues here, firstly your using bash arrays, which is depreciated, and secondly your treating 'lo' as the network connection, when you should be configuring "enp0s25" (are you *sure* thats correct? .. seems to have an extra digit tagged on).

```
modules_enp0s2="dhcpcd"

config_enp0s2="dhcp"

dhcpcd_enp0s2="-t 10"

dns_servers_enp0s2="192.168.1.1 8.8.8.8 8.8.4.4"
```

So, nothing need be provided for 'lo' ... and btw, any reason for using google-dns ... you probably only need to define the DNS resolver from the gateway.

 *Arcenturion wrote:*   

> By the way, how do you post logs without having to type it out by hand, especially when the logs are from another computer without an internet connection?

 

That would be farily difficult from a machine without networking, you could however dump the output to a file and transfer the file via a usbkey to a machine that does.

best ... khay

----------

## Arcenturion

Thanks for responding and telling me how to easily post logs.

So, here's my ifconfig -a.

```

enp0s25: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500

        ether 00:1a:6b:d0:0e:21  txqueuelen 1000  (Ethernet)

        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

        device interrupt 20  memory 0xfe000000-fe020000  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536

        inet 127.0.0.1  netmask 255.0.0.0

        loop  txqueuelen 0  (Local Loopback)

        RX packets 433  bytes 29594 (28.9 KiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 433  bytes 29594 (28.9 KiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

sit0: flags=193<UP,RUNNING,NOARP>  mtu 1480

        inet6 ::127.0.0.1  prefixlen 96  scopeid 0x90<compat,host>

        sit  txqueuelen 0  (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 196  dropped 0 overruns 0  carrier 0  collisions 0

wlp3s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500

        ether 00:13:e8:b1:53:dd  txqueuelen 1000  (Ethernet)

        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

```

----------

## krinn

Here's the manual way, that should fix your issue and later the net config to have the same effect (without dhcpcd as i just don't like that).

```
ifconfig enp0s25 192.168.1.2 

route add default gw 192.168.1.1

echo "nameserver 8.8.8.8" >> /etc/resolv.conf

ping -c1 www.google.com

```

You should be able to post from the non working computer then.

and config to have that is :

```
config_enp0s25="192.168.1.2 netmask 255.255.255.0 brd 192.168.1.255"

routes_enp0s25="default via 192.168.1.1"

dns_servers_enp0s25="8.8.8.8"

```

Or use the one provide by khayyam just changing enp0s2 with enp0s25 to get your dhcp config.

----------

## Arcenturion

Here's my new ifconfig -a.

```
enp0s25: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500

        inet 192.168.1.146  netmask 255.255.255.0  broadcast  192.168.1.255

        ether 00:1a:6b:d0:0e:21  txqueuelen 1000  (Ethernet)

        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

        device interrupt 20  memory 0xfe000000-fe020000 

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536

        inet 127.0.0.1  netmask 255.0.0.0

        loop  txqueuelen 0  (Local Loopback)

        RX packets 433  bytes 29594 (28.9 KiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 433  bytes 29594 (28.9 KiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

sit0: flags=193<UP,RUNNING,NOARP>  mtu 1480

        inet6 ::127.0.0.1  prefixlen 96  scopeid 0x90<compat,host>

        sit  txqueuelen 0  (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 196  dropped 0 overruns 0  carrier 0  collisions 0

wlp3s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500

        ether 00:13:e8:b1:53:dd  txqueuelen 1000  (Ethernet)

        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 

```

----------

## krinn

the question is: does it work now ?  :Smile: 

----------

## Arcenturion

Sadly, no. If I combine the /etc/conf.d/net configuration from both of you, will that cause problems?

I'll try to repeat what you guys told me to do, because I'm not sure if I did it right. I'll be sure to report back.

----------

## Arcenturion

Okay, so my ifconfig -a is still the same, and here's how /etc/conf.d/net file is now:

```

modules_enp0s25="dhcpcd"

config_enp0s25="dhcp"

dhcpcd_enp0s25="-t 10"

dns_sservers_enp0s25="192.168.1.1 8.8.8.8 8.8.4.4"

config_enp0s25="192.168.1.1 netmask 255.255.255.0 brd 192.168.1.255"

routes_en0s25="default via 192.168.1.1"

```

Pinging Google now has a delay before it returns the "unknown host" error.

----------

## krinn

You shouldn't of course use both, use dhcp or fix one.

```

dns_sservers_enp0s25="192.168.1.1 8.8.8.8 8.8.4.4"

config_enp0s25="192.168.1.146 netmask 255.255.255.0 brd 192.168.1.255"

routes_en0s25="default via 192.168.1.1"

```

```

modules_enp0s25="dhcpcd"

config_enp0s25="dhcp"

dhcpcd_enp0s25="-t 10"

dns_sservers_enp0s25="192.168.1.1 8.8.8.8 8.8.4.4"

routes_en0s25="default via 192.168.1.1"

```

And look at this one :

```
config_enp0s25="192.168.1.1 netmask 255.255.255.0 brd 192.168.1.255"
```

You are telling system to use a fixed ip adress 192.168.1.1 when your router use that one too.

So you should use any from the range except one already in use, and 1 is use by your router

I have set it to 146 as you just show that one was assign previously.

----------

## Arcenturion

So, after I did what you guys told me to, plus doing a reboot of my Thinkpad, I can ping Google now! Thanks so much!

----------

## krinn

Glad it works, not that hard finally no ?

You could help others users by editing your first thread to change title with a [SOLVED] in it, so users searching answers to questions your thread has raised will easy see they could find a solve in your, making it valuable.

----------

