# Home made router acting up.

## teapot

Hello!

Just to be cool I wanted to build my own router to get rid of my linksys crap from 2005.

I followed the Gentoo Router Guide to turn an old socket A motherboard into a functional router.

It is working for extended periods of time, often 5-6 hours or more before it starts to cause problems.

On my clients I start to notice sluggish internet performance and horrible ping times of 3000+ ms.

I can however log onto the router as root over the LAN to do some diagnostics. CPU and RAM usage is normal and the swap is barely unused.

Restarting the router solves the issue. 

One time it was enough just to restart eth2 (WAN).

The router is an old Athlon 1600+ running under clocked at 1050  MHz with 256 mb RAM and a 20 GB HDD.

Swap is set to 256 MB. 

I have 2 TP-Link TG-3269 ethernet cards ( realtech-8169 chip)

Kernel version is 3.1.6.

Also , cpu temperature is normal.

Can someone give me some pointers to what might be wrong ?

----------

## Jaglover

I bought one of these and installed it on the LAN side, all problems just disappeared. 

http://www.newegg.com/Product/Product.aspx?Item=N82E16833106121

I host Gentoo Portage for all Gentoo boxes in it and share it over NFS, that certainly generates some traffic.

----------

## teapot

 *Jaglover wrote:*   

> I bought one of these and installed it on the LAN side, all problems just disappeared. 
> 
> http://www.newegg.com/Product/Product.aspx?Item=N82E16833106121
> 
> I host Gentoo Portage for all Gentoo boxes in it and share it over NFS, that certainly generates some traffic.

 

Well, I was thinking more in the line of getting the stuff I already have to work.

I just experienced the problem like 5 minutes ago.

Interestingly , the ping times on the internal to the routers eth1 interface is good

The problem is the WAN port where I get ping times of more than 3 seconds even from a remote shell on the actual router. 

I set eth2 up without any particular configuration so that it connects via DHCP to my ISP.

----------

## Jaglover

I'd try swapping ports to see if problem follows that particular NIC.

----------

## albright

is there anything in /var/log/messages about that interface,

e.g. interrupt problems?

I was getting some symptoms like yours and found the

dreaded "nobody cared" error 

As the error message suggested, putting "irqpoll" into

my grub boot line seems to have fixed the problem ...

----------

## wcg

If your kernel has netfilter connection tracking enabled,

you can end up with some long hash chains (linked lists) to

search from tcp sessions being abandoned by remote apps

without closing the tcp session.

Try this:

```

echo 600 > /proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_established

```

(Default value in 2.6.x seems to be 432000. This is a value in seconds.

If this helps, you can add this to /etc/sysctl.conf.)

[edit:] Value in minutes? Principle is the same, though, too long a time

for kernel to keep tracking sessions that the other end has long

abandoned vs a time so short that sessions still in use get arbitrarily

terminated. 10 hours seems easily long enough for most uses, hence "600".

[/edit]

For a more general approach to conntrack tuning that operates at

a higher level in the /proc/ heirarchy (and on different data structures,

presumably), see:

http://antmeetspenguin.blogspot.com/2011/01/high-performance-linux-router.html

----------

