# ethernet not working after being disconnected

## Adel Ahmed

my ethernet gets accidentally disconnected, after reconnecting there is no connection

g50-80 ~ # ethtool enp2s0

Settings for enp2s0:

Cannot get device settings: No such device

Cannot get wake-on-lan settings: No such device

Cannot get message level: No such device

Cannot get link status: No such device

No data available

the following message is repeated frequently in journalctl:

Jul 01 14:14:18 g50-80 kernel: r8169 0000:02:00.0 enp2s0: rtl_counters_cond == 1 (loop: 1000, delay: 10).

----------

## Adel Ahmed

bump

----------

## Adel Ahmed

bump

----------

## sebB

How did you build your driver? Module or hard?

----------

## ct85711

How is the cable to the ethernet hooked up?  Like is it going directly to another computer or to a switch/router/modem?

Have you tried replacing the cable and/or the ethernet card?  Most ethernet cards and switches/routers have a green led light next to the port (a link state light) that is just detecting if a cable is hooked up or not.  Note:  There will usually be a second LED light for activity.

----------

## Adel Ahmed

ethernet driver is built into the kernel

the cable is directly attached to another computer

I'll pay attention next time to the LEDS, the other ethernet card is working just fine I know that because rebooting this laptop(the one in reference) fixes things.

----------

## ct85711

One thing to make sure, since you said you are connecting directly from computer to another one without a switch/hub/router in between, is that you are using a cross-over cable and not a patch/straight cable.  

Autosense (detects if a cross-over is needed) does not always work too well; so you should aim to use the correct cabling when connecting 2 devices.  If you have an hub or switch in between the 2 computers, you use a patch/straight cable.  Do not get this mixed with the auto-negotiation, as that determines what speed both devices are using (which can cause duplex mismatch affecting performance).

Note:  Most cables will have it printed on them on if they are cross-over or straight.  For the ones that are not, you can look at the wiring layout in the connectors and match that up to the cabling chart (easily found on the web).  Most cables tend to NOT be cross-over cables.

----------

## vilehost

https://bugzilla.kernel.org/show_bug.cgi?id=107421

its been reported many times

when it dc's next test to see if the hw still shows up

```
 % lspci

05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 06)

```

https://lkml.org/lkml/2016/2/24/88

 *Quote:*   

> There will be a log spam when there is no cable plugged. Please refer to
> 
> following links. https://bugzilla.kernel.org/show_bug.cgi?id=104351
> 
> https://bugzilla.kernel.org/show_bug.cgi?id=107421
> ...

 

not sure it's the same issue, but the symptom is the same.. it thinks theres no cable plugged in.

i think your eth card is crashing(rebooting hw in such cases usually will work it just isnt being allocated power after the first time it shuts off accidentally without the rest of the cpu going down with it which to me makes me think hw issue) rebuild the kernel module... though theres no reason a kernel you've been using with out issue would start doing this all of a sudden

or it's crossover/ethernet bridge related

----------

