# Ethernet occasionally drops

## cwc

My Ethernet connection drops occasionally, so I thought I'd post on the worlds greatest Linux forum asking if anyone had any ideas why?

I'm running three routers and a switch .

routers running dd-wrt and a switch with my gentoo box,  a rasp pi and a Mac (Lion) sometimes all hardwired.

Linksys E3200  is the main router to a Netgear GS105 1Gig.

Is there a log for Ethernet?

Thanks

```

azzerare ~ # uname -a

Linux azzerare 3.12.13-gentoo #1 SMP Sat Mar 8 21:17:41 PST 2014 x86_64 AMD Athlon(tm) 64 Processor 3400+ AuthenticAMD GNU/Linux

azzerare ~ # lspci

00:12.0 Ethernet controller: VIA Technologies, Inc. VT6102 [Rhine-II] (rev 7c)

04:01.0 Audio device: VIA Technologies, Inc. VT8237A/VT8251 HDA Controller

azzerare ~ # free -m

             total       used       free     shared    buffers     cached

Mem:          3231       1032       2198          0         23        486

-/+ buffers/cache:        522       2709

Swap:         8192          0       8192

azzerare ~ # 

```

----------

## szatox

I think you could run traceroute or tracepath to some arbitrary IP address somewhere out in the wilds of the internet to determine which device/wire couses problems. Obviously you should do that while your internet is down  :Smile: 

it is also possible that your setup couses problems, in this case more datails would be handy. How are your devices interconnected? Don't you have loops by any chance? MAybe IP conflict? you know, 2 separated subnetworks sharing a single IP pool or something like that.

----------

## cwc

 *szatox wrote:*   

> I think you could run traceroute or tracepath to some arbitrary IP address somewhere out in the wilds of the internet to determine which device/wire couses problems. Obviously you should do that while your internet is down 
> 
> it is also possible that your setup couses problems, in this case more datails would be handy. How are your devices interconnected? Don't you have loops by any chance? MAybe IP conflict? you know, 2 separated subnetworks sharing a single IP pool or something like that.

 

I'm also considering purchasing a pci nic.

----------

## Chiitoo

I wonder if it's not simply a hardware failure.

Just a while ago, my (ADSL) connection started to go weird.  It was seemingly random, without any pattern that I could discern.  My connection to the ISP seemed to stay up, so it was just the connection to the ADSL-modem that started dropping.

For a long time, I thought it was the cable from a laptop that had gone bad, as it seemed to not do it after I switched that.  The issue would, however, return.  At some point, it started to do it for my main machine as well.  I don't know if any sort of debug switches would have helped me decide on the problem sooner; the output might have been similar, if not identical to that of re-plugging the LAN-cable.

My /var/log/messages has some 5000 of each, 'link up' and 'link down' lines since December 2013.  It would sometimes happen several times within a minute, or not at all for 12 hours or more.  It was so quick to come back up, that it didn't even drop me from on-line games most of the time, but needless to say, it started to bug me quite a bit regardless.

I tried different kernel versions from before the time they started to show up in the logs a lot.  I tried adding a firmware patch (rtl_nic/rtl8168d-2.fw), which made no difference that I could see.

I also tried using an old PCI NIC I had stashed, even though at that point I had noticed the issue on more than one machine.  Still, the issue wasn't that apparent for users utilising Windows, apparently.  But as I mentioned, the link came back up so quickly for me, too, that it was not always too noticeable.  There's also the fact that I can see the modem at all times while here, so I would see the LAN light(s) go off and on (and then there are my logs, of course).  Curiously, the Windows machines did not exhibit the behaviour regarding those lights.

I did not really bother testing if the issue could even be seen on a Windows machine.  Those users did mention noticing something, but it could have very well been something else.

Either way, once I finally got a different modem to try out with, the up & down linking did come to an end.  Presently, it would indeed seem that my initial fear had some truth to it.  It may just be that the box (Zyxel Prestige 660H-61) has simply come to the end of its journey.  It did serve me since 2006, though, which isn't too bad considering the identical box it replaced got zapped by lightning.  ^^;

Now I just need to put OpenWrt into this 'new' one (rebranded Bewan Ibox)...

Anyblue, sorry for the story-time.  I couldn't find one exactly like mine at the time of my woe, so now at least one exists!

There's also another point in it: did the same set-up work fine until now?

If yes, I might consider a hardware-fault mighty plausible.

----------

## cwc

 *cwc wrote:*   

>  *szatox wrote:*   I think you could run traceroute or tracepath to some arbitrary IP address somewhere out in the wilds of the internet to determine which device/wire couses problems. Obviously you should do that while your internet is down 
> 
> it is also possible that your setup couses problems, in this case more datails would be handy. How are your devices interconnected? Don't you have loops by any chance? MAybe IP conflict? you know, 2 separated subnetworks sharing a single IP pool or something like that. 
> 
> I'm also considering purchasing a pci nic.

 

epic post!

----------

## Jaglover

Having three routers sounds a little off, do you have three ISP's?

----------

## krinn

It might help you logging your router log. Here's how i do that.

Set router to log to IP# using udp

Set your syslog-ng with 

```
source others {

udp();

};

destination others { file("/var/log/$HOST.log" owner(root) group(root) perm(0600)); };

log { source(others); destination(others); };

```

Now you get your routers log by their IP. This include losing connection, reconnecting... messages and the timestamp. You can at least see what router have a problem, what problem it is...

```
Apr  4 22:30:17 192.168.0.100 [DOS Attack] : 1 [ACK Scan] packets detected in last 20 seconds, source ip [91.198.174.208]

```

----------

## cwc

 *krinn wrote:*   

> It might help you logging your router log. Here's how i do that.
> 
> Set router to log to IP# using udp
> 
> Set your syslog-ng with 
> ...

 

Woooo.  this is epic.  Now the question is where do I put this script.  I'll need to be spoon fed on this one.  

Is this where I put the script:  console_all { file("/dev/console"); };

azzerare ~ # more /etc/syslog-ng/syslog-ng.conf 

I'd also like to try this from my 

RaspPi  http://96.41.217.172:8000/

----------

## cwc

 *Jaglover wrote:*   

> Having three routers sounds a little off, do you have three ISP's?

 

I am a little off.  I don't have a smart phone and I use the routers so I can stream outside with my ipod while I work in the yard.

I also helps with my our tablets.

----------

