View previous topic :: View next topic |
Author |
Message |
Kim84 n00b
Joined: 10 Nov 2004 Posts: 8
|
Posted: Wed Nov 10, 2004 1:00 am Post subject: ip_conntrack shows old and closed connections |
|
|
Hello.
I am using netstat-nat fairly often for monitoring. As far as I'm aware of, it's a parsing output from the ip_conntrack module (/proc/net/ip_conntrack). After a few days of running, I can see some old connections from computers which are not even online at the time. How can it be? My guess is that it waits for the FIN package and the connections I can see haven't yet sent this one. Am I right about this -- and is there anyway I can fix this?
I am running Gentoo with the gentoo-sources kernel "2.4.26-gentoo-r8". |
|
Back to top |
|
|
befa Apprentice
Joined: 28 Oct 2004 Posts: 208 Location: rennes
|
Posted: Wed Nov 10, 2004 1:36 am Post subject: |
|
|
i think the best way to see your ip_conntrack module is to do
Code: |
less /proc/net/ip_conntrack
|
then you type [shift] f to go at the end....and you wait...:lol
or if you just want the 10 last lines you can make
Code: | tail /proc/net/ip_conntrack |
i can't do more....
p.s: sorry for my bad english! _________________ Open Minds! Open Sources! Open Future!
think_tux@jabber.org |
|
Back to top |
|
|
Kim84 n00b
Joined: 10 Nov 2004 Posts: 8
|
Posted: Wed Nov 10, 2004 1:39 am Post subject: |
|
|
Sure, but I already have 'netstat-nat' for that. I wish to get rid of the connections, which really aren't there anymore (like the ones i've had the last 4 days, which points to a machine which is turned off) |
|
Back to top |
|
|
befa Apprentice
Joined: 28 Oct 2004 Posts: 208 Location: rennes
|
Posted: Wed Nov 10, 2004 1:42 am Post subject: |
|
|
in fact i know
but no ??? _________________ Open Minds! Open Sources! Open Future!
think_tux@jabber.org |
|
Back to top |
|
|
Kim84 n00b
Joined: 10 Nov 2004 Posts: 8
|
Posted: Wed Nov 10, 2004 1:44 am Post subject: |
|
|
Oh, take a look at the package "net-misc/netstat-nat" then |
|
Back to top |
|
|
befa Apprentice
Joined: 28 Oct 2004 Posts: 208 Location: rennes
|
Posted: Wed Nov 10, 2004 1:48 am Post subject: |
|
|
oops sorry...so i post for nothing....excuse me... _________________ Open Minds! Open Sources! Open Future!
think_tux@jabber.org |
|
Back to top |
|
|
Kim84 n00b
Joined: 10 Nov 2004 Posts: 8
|
Posted: Wed Nov 10, 2004 1:50 am Post subject: |
|
|
No problems at all |
|
Back to top |
|
|
Kim84 n00b
Joined: 10 Nov 2004 Posts: 8
|
Posted: Thu Nov 11, 2004 12:30 am Post subject: |
|
|
Noone knows anything about this at all? |
|
Back to top |
|
|
3lithium n00b
Joined: 07 Mar 2004 Posts: 54
|
Posted: Thu Nov 11, 2004 9:51 am Post subject: |
|
|
Are those ESTABLISHED tcp connections?
ip_conntrack seems to use a ttl of 5 days (432 000 seconds) for those. I think you have to patch iptables if you need to decrease this timeout. It has never been a problem for me though - I've got a few of them but there's plenty of room left for other connections. |
|
Back to top |
|
|
Kim84 n00b
Joined: 10 Nov 2004 Posts: 8
|
Posted: Thu Nov 11, 2004 1:32 pm Post subject: |
|
|
> Are those ESTABLISHED tcp connections?
Yes they are.
> ip_conntrack seems to use a ttl of 5 days (432 000 seconds) for those. I think you have to patch iptables if you need to decrease this timeout. It has never been a problem for me though - I've got a few of them but there's plenty of room left for other connections.
Okay, 5 days isn't that bad - as long as they have a ttl in the long run. I currently have about 800 of those connections... I could live with that, but is there another way around fixing this, other than using a lower ttl? |
|
Back to top |
|
|
3lithium n00b
Joined: 07 Mar 2004 Posts: 54
|
Posted: Thu Nov 11, 2004 2:47 pm Post subject: |
|
|
Like you guessed, the connection tracking code is waiting for an indication that the connection has been closed (FIN or RST or whatever). The 5 day ttl is conservative, but it's perfectly possible for a connection to be valid even though no packets have been seen for a couple of days.
If you don't want to lower the timeout you're probably pretty much left with trying to find out why those connections doesn't get closed and doing something about that. If there's a lot of them it might be an indication of a suboptimal configuration elsewhere, or perhaps ill-mannered software being used on the network. |
|
Back to top |
|
|
Kim84 n00b
Joined: 10 Nov 2004 Posts: 8
|
Posted: Thu Nov 11, 2004 2:57 pm Post subject: |
|
|
You got a point there -- and thanks for confirming that my guess right. I think it's most likely to be bad software on the network, but in this position, it's nothing I can do anything about.
I have a minor subquestion for this. Is it possible to tell the tracker that some connections aren't being used?
Thanks a lot for your help so far. I really appreciate it. |
|
Back to top |
|
|
3lithium n00b
Joined: 07 Mar 2004 Posts: 54
|
Posted: Thu Nov 11, 2004 3:08 pm Post subject: |
|
|
AFAIK there's no way to kill specific tracked connections. |
|
Back to top |
|
|
Kim84 n00b
Joined: 10 Nov 2004 Posts: 8
|
Posted: Thu Nov 11, 2004 3:19 pm Post subject: |
|
|
Okay, thanks a lot for your help |
|
Back to top |
|
|
|