{"id":132,"date":"2005-05-26T00:31:43","date_gmt":"2005-05-25T21:31:43","guid":{"rendered":"https:\/\/void.gr\/kargig\/blog\/?p=132"},"modified":"2005-05-26T00:35:16","modified_gmt":"2005-05-25T21:35:16","slug":"linux-ip-accounting","status":"publish","type":"post","link":"https:\/\/www.void.gr\/kargig\/blog\/2005\/05\/26\/linux-ip-accounting\/","title":{"rendered":"Linux IP accounting"},"content":{"rendered":"<p>Time for some more statistics.  Say your box runs as a router and you want to monitor which pc of your lans talks to whom from the outside world&#8230;how many bytes, packets, flows, etc&#8230;or say you use your box at home for p2p applications and want to monitor what&#8217;s going on&#8230;more than just keeping track of your traffic. That&#8217;s where IP accounting comes handy.<br \/>\nI applied IP accounting at my gentoo box at home. What I needed was inside <a href=\"http:\/\/www.dynamicnetworks.us\/netflow\/index.html\">this excellent documentation<\/a>. Basically one needs <a href=\"http:\/\/fprobe.sourceforge.net\/\">fprobe<\/a>, to export flows from linux in netflow format,  <a href=\"http:\/\/www.splintered.net\/sw\/flow-tools\/\">flow-tools<\/a> to collect those netflows, and <a href=\"http:\/\/net.doit.wisc.edu\/%7Eplonka\/FlowScan\/\">FlowScan<\/a> to process the flow files.  Most tools are easily emerged&#8230;but remember NOT to emerge flow-tools. If you do that you will have problems with Cflow. Do as the documentation says, download flow-tools from their site, &#8216;make install&#8217; it and go inside the contrib dir, untar Cflow-1.051.tar.gz and do as the documentation says for it. Most other things are rather straightforward.<br \/>\nOne usefull shell script I wrote with the help of Angelos was this:<br \/>\nshowtop.sh<br \/>\n<code><br \/>\n#!\/bin\/bash<br \/>\necho \"&lt;pre&gt;\" &gt; \/var\/netflow\/scoreboard\/stats.html<br \/>\n\/usr\/local\/netflow\/bin\/flow-cat -p \/var\/netflow\/ft\/ | \/usr\/local\/netflow\/bin\/flow-stat -f10 -S4 -n | head -n 50 &gt;&gt; \/var\/netflow\/scoreboard\/stats.html           \/usr\/local\/netflow\/bin\/flow-cat -p \/var\/netflow\/ft\/ | \/usr\/local\/netflow\/bin\/flow-stat -f8 -S3 -n| head -n 50 &gt;&gt; \/var\/netflow\/scoreboard\/stats.html             echo \"&lt;\/pre&gt;\" &gt;&gt; \/var\/netflow\/scoreboard\/stats.html<br \/>\n<\/code><\/p>\n<p>It creates an html file with 2 top-X lists&#8230;<br \/>\nThe first one is: a report on top source\/destination IP pairs sorted by octets<br \/>\nand the second one is: a top destination IP address report by sorted by outbound traffic<br \/>\nI find it really usefull and I&#8217;ve added it to my crontab to run every 5 minutes.<\/p>\n<p>It works for me&#8230;try it if you wish and comment with your results&#8230;<\/p>\n<p>P.S. I think flow-tools was the first package I had to install manually in my gentoo box since the day I&#8217;ve installed it. I think it is possible to create an ebuild to overcome the problems with Cflow&#8230;but I was too bored&#8230;anyway&#8230;have fun with IP accounting.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Time for some more statistics. Say your box runs as a router and you want to monitor which pc of your lans talks to whom from the outside world&#8230;how many bytes, packets, flows, etc&#8230;or say you use your box at home for p2p applications and want to monitor what&#8217;s going on&#8230;more than just keeping track [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ep_exclude_from_search":false,"footnotes":""},"categories":[1,3],"tags":[],"class_list":["post-132","post","type-post","status-publish","format-standard","hentry","category-general","category-linux"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.3 - aioseo.com -->\n\t<meta name=\"description\" content=\"Time for some more statistics. Say your box runs as a router and you want to monitor which pc of your lans talks to whom from the outside world...how many bytes, packets, flows, etc...or say you use your box at home for p2p applications and want to monitor what&#039;s going on...more than just keeping track\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"kargig\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.void.gr\/kargig\/blog\/2005\/05\/26\/linux-ip-accounting\/\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.3\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/2005\\\/05\\\/26\\\/linux-ip-accounting\\\/#article\",\"name\":\"Linux IP accounting | Into.the.Void.\",\"headline\":\"Linux IP accounting\",\"author\":{\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/author\\\/site-admin\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/#organization\"},\"datePublished\":\"2005-05-26T00:31:43+03:00\",\"dateModified\":\"2005-05-26T00:35:16+03:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/2005\\\/05\\\/26\\\/linux-ip-accounting\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/2005\\\/05\\\/26\\\/linux-ip-accounting\\\/#webpage\"},\"articleSection\":\"General, Linux\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/2005\\\/05\\\/26\\\/linux-ip-accounting\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/category\\\/general\\\/#listItem\",\"name\":\"General\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/category\\\/general\\\/#listItem\",\"position\":2,\"name\":\"General\",\"item\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/category\\\/general\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/2005\\\/05\\\/26\\\/linux-ip-accounting\\\/#listItem\",\"name\":\"Linux IP accounting\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/2005\\\/05\\\/26\\\/linux-ip-accounting\\\/#listItem\",\"position\":3,\"name\":\"Linux IP accounting\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/category\\\/general\\\/#listItem\",\"name\":\"General\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/#organization\",\"name\":\"Into.the.Void.\",\"description\":\"Into The Void\",\"url\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/\",\"sameAs\":[\"https:\\\/\\\/x.com\\\/kargig\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/author\\\/site-admin\\\/#author\",\"url\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/author\\\/site-admin\\\/\",\"name\":\"kargig\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/2005\\\/05\\\/26\\\/linux-ip-accounting\\\/#webpage\",\"url\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/2005\\\/05\\\/26\\\/linux-ip-accounting\\\/\",\"name\":\"Linux IP accounting | Into.the.Void.\",\"description\":\"Time for some more statistics. Say your box runs as a router and you want to monitor which pc of your lans talks to whom from the outside world...how many bytes, packets, flows, etc...or say you use your box at home for p2p applications and want to monitor what's going on...more than just keeping track\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/2005\\\/05\\\/26\\\/linux-ip-accounting\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/author\\\/site-admin\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/author\\\/site-admin\\\/#author\"},\"datePublished\":\"2005-05-26T00:31:43+03:00\",\"dateModified\":\"2005-05-26T00:35:16+03:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/\",\"name\":\"Into.the.Void.\",\"description\":\"Into The Void\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Linux IP accounting | Into.the.Void.","description":"Time for some more statistics. Say your box runs as a router and you want to monitor which pc of your lans talks to whom from the outside world...how many bytes, packets, flows, etc...or say you use your box at home for p2p applications and want to monitor what's going on...more than just keeping track","canonical_url":"https:\/\/www.void.gr\/kargig\/blog\/2005\/05\/26\/linux-ip-accounting\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.void.gr\/kargig\/blog\/2005\/05\/26\/linux-ip-accounting\/#article","name":"Linux IP accounting | Into.the.Void.","headline":"Linux IP accounting","author":{"@id":"https:\/\/www.void.gr\/kargig\/blog\/author\/site-admin\/#author"},"publisher":{"@id":"https:\/\/www.void.gr\/kargig\/blog\/#organization"},"datePublished":"2005-05-26T00:31:43+03:00","dateModified":"2005-05-26T00:35:16+03:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.void.gr\/kargig\/blog\/2005\/05\/26\/linux-ip-accounting\/#webpage"},"isPartOf":{"@id":"https:\/\/www.void.gr\/kargig\/blog\/2005\/05\/26\/linux-ip-accounting\/#webpage"},"articleSection":"General, Linux"},{"@type":"BreadcrumbList","@id":"https:\/\/www.void.gr\/kargig\/blog\/2005\/05\/26\/linux-ip-accounting\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.void.gr\/kargig\/blog\/#listItem","position":1,"name":"Home","item":"https:\/\/www.void.gr\/kargig\/blog\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.void.gr\/kargig\/blog\/category\/general\/#listItem","name":"General"}},{"@type":"ListItem","@id":"https:\/\/www.void.gr\/kargig\/blog\/category\/general\/#listItem","position":2,"name":"General","item":"https:\/\/www.void.gr\/kargig\/blog\/category\/general\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.void.gr\/kargig\/blog\/2005\/05\/26\/linux-ip-accounting\/#listItem","name":"Linux IP accounting"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.void.gr\/kargig\/blog\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.void.gr\/kargig\/blog\/2005\/05\/26\/linux-ip-accounting\/#listItem","position":3,"name":"Linux IP accounting","previousItem":{"@type":"ListItem","@id":"https:\/\/www.void.gr\/kargig\/blog\/category\/general\/#listItem","name":"General"}}]},{"@type":"Organization","@id":"https:\/\/www.void.gr\/kargig\/blog\/#organization","name":"Into.the.Void.","description":"Into The Void","url":"https:\/\/www.void.gr\/kargig\/blog\/","sameAs":["https:\/\/x.com\/kargig"]},{"@type":"Person","@id":"https:\/\/www.void.gr\/kargig\/blog\/author\/site-admin\/#author","url":"https:\/\/www.void.gr\/kargig\/blog\/author\/site-admin\/","name":"kargig"},{"@type":"WebPage","@id":"https:\/\/www.void.gr\/kargig\/blog\/2005\/05\/26\/linux-ip-accounting\/#webpage","url":"https:\/\/www.void.gr\/kargig\/blog\/2005\/05\/26\/linux-ip-accounting\/","name":"Linux IP accounting | Into.the.Void.","description":"Time for some more statistics. Say your box runs as a router and you want to monitor which pc of your lans talks to whom from the outside world...how many bytes, packets, flows, etc...or say you use your box at home for p2p applications and want to monitor what's going on...more than just keeping track","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.void.gr\/kargig\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.void.gr\/kargig\/blog\/2005\/05\/26\/linux-ip-accounting\/#breadcrumblist"},"author":{"@id":"https:\/\/www.void.gr\/kargig\/blog\/author\/site-admin\/#author"},"creator":{"@id":"https:\/\/www.void.gr\/kargig\/blog\/author\/site-admin\/#author"},"datePublished":"2005-05-26T00:31:43+03:00","dateModified":"2005-05-26T00:35:16+03:00"},{"@type":"WebSite","@id":"https:\/\/www.void.gr\/kargig\/blog\/#website","url":"https:\/\/www.void.gr\/kargig\/blog\/","name":"Into.the.Void.","description":"Into The Void","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.void.gr\/kargig\/blog\/#organization"}}]}},"aioseo_meta_data":{"post_id":"132","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2022-01-04 12:02:20","updated":"2026-10-21 09:09:39","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.void.gr\/kargig\/blog\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.void.gr\/kargig\/blog\/category\/general\/\" title=\"General\">General<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tLinux IP accounting\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.void.gr\/kargig\/blog\/"},{"label":"General","link":"https:\/\/www.void.gr\/kargig\/blog\/category\/general\/"},{"label":"Linux IP accounting","link":"https:\/\/www.void.gr\/kargig\/blog\/2005\/05\/26\/linux-ip-accounting\/"}],"views":5370,"_links":{"self":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts\/132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/comments?post=132"}],"version-history":[{"count":0,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts\/132\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/media?parent=132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/categories?post=132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/tags?post=132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}