All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: connection tracking without iptables?
@ 2004-09-29 21:22 Daniel Chemko
  2004-09-30  2:24 ` Jiann-Ming Su
  0 siblings, 1 reply; 16+ messages in thread
From: Daniel Chemko @ 2004-09-29 21:22 UTC (permalink / raw)
  To: Jiann-Ming Su, netfilter

Jiann-Ming Su wrote:
> This is probably a dumb question, but is it possible to track
> connections without iptables/netfilter?

Yeah, use libpcap and parse it out yourself! (snicker)

Exactly what are you looking for and why? A good chunk of netfilter is
*just* connection tracking. What do you expect to get out of just
conntrack?



^ permalink raw reply	[flat|nested] 16+ messages in thread
* RE: connection tracking without iptables?
@ 2004-09-30 23:20 Daniel Chemko
  0 siblings, 0 replies; 16+ messages in thread
From: Daniel Chemko @ 2004-09-30 23:20 UTC (permalink / raw)
  To: Jiann-Ming Su; +Cc: netfilter

> Another thing I'm interested in is the total number of current
> connections.  Does /proc/net/ip_conntrack provide this info?  I've
> taken my iptables firewall offline,  and I would expect
> /proc/net/ip_conntrack to show very few connections, but it seems to
> still have quite a bit of historical connections left in it.

/proc/net/ip_conntrack lists all the connections the firewall is
involved with and all traffic that flows through the firewall. If you've
got a lot of active sessions, you may need to filter down the number of
entries you are using. Active sessions always use the ESTABLISHED state
value, so you may just have a lot of CLOSE_WAIT's around. They may be
relevent if you have TOO many closed states. When I first applied the
tcp_window patches to netfilter, I saw thousands of close_waits.

Ex:
cat /proc/net/ip_conntrack | wc -l                   
    598
cat /proc/net/ip_conntrack | grep ESTABLISHED | wc -l
    362
cat /proc/net/ip_conntrack | grep ESTABLISHED | grep dport=25 | wc -l
      7
cat /proc/net/ip_conntrack | grep ESTABLISHED | grep dport=80 | wc -l  
    211


^ permalink raw reply	[flat|nested] 16+ messages in thread
* RE: connection tracking without iptables?
@ 2004-09-30 18:19 Daniel Chemko
  2004-09-30 18:26 ` Jason Opperisano
  2004-09-30 23:04 ` Jiann-Ming Su
  0 siblings, 2 replies; 16+ messages in thread
From: Daniel Chemko @ 2004-09-30 18:19 UTC (permalink / raw)
  To: Jiann-Ming Su, netfilter

> Just trying to get an idea of the type and amount of traffic passing
> through a subnet.  I've done this before with tcpdump, but that
> required an external parsing program to reconstitute all the
> connections from the tcpdump capture.

The way I track this kind of information is from netfilter/iptables.

In the PREROUTING and POSTROUTING chains, you implement 'null' targets
to add an internal netfilter counter to the packet stream.

# Detect all outgoing web traffic from that subnet
iptables -t mangle -A PREROUTING --source ${mynet}/${mymask} -p tcp
--dport 80 
# Return Traffic
iptables -t mangle -A PREROUTING --destination ${mynet}/${mymask} -p tcp
--sport 80

You may find this a little kludgy. I guess it is. The other alternative
is to use IP accounting packages which are pre-built to do this stuff.
You may find http://www.ntop.org/ntop.html or http://www.cacti.net/
useful if you don't feel like doing it yourself.


^ permalink raw reply	[flat|nested] 16+ messages in thread
* connection tracking without iptables?
@ 2004-09-29 20:50 Jiann-Ming Su
  2004-09-29 20:57 ` Alexis
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Jiann-Ming Su @ 2004-09-29 20:50 UTC (permalink / raw)
  To: netfilter

This is probably a dumb question, but is it possible to track
connections without iptables/netfilter?
-- 
Jiann-Ming Su
"I have to decide between two equally frightening options.  
                                            If I wanted to do that,
I'd vote." --Duckman


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2004-10-25 20:48 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-29 21:22 connection tracking without iptables? Daniel Chemko
2004-09-30  2:24 ` Jiann-Ming Su
  -- strict thread matches above, loose matches on Subject: below --
2004-09-30 23:20 Daniel Chemko
2004-09-30 18:19 Daniel Chemko
2004-09-30 18:26 ` Jason Opperisano
2004-09-30 23:04 ` Jiann-Ming Su
2004-09-30 23:34   ` Jason Opperisano
2004-10-14 18:31     ` Jiann-Ming Su
2004-10-14 18:57       ` Jason Opperisano
2004-10-15  5:16         ` Kiran Kumar Immidi
2004-10-16 12:30       ` Jose Maria Lopez
2004-10-25 20:48       ` Aleksandar Milivojevic
2004-09-29 20:50 Jiann-Ming Su
2004-09-29 20:57 ` Alexis
2004-09-29 21:01 ` Jason Opperisano
2004-09-29 21:37 ` Jose Maria Lopez

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.