Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Joel Newkirk <netfilter@newkirk.us>
To: gummi7@simnet.is, netfilter@lists.netfilter.org
Subject: Re: Measuring traffic that goes thrugh a specific IP
Date: Thu, 6 Feb 2003 00:39:58 -0500	[thread overview]
Message-ID: <200302060039.58779.netfilter@newkirk.us> (raw)
In-Reply-To: <isapiwc.433ab781.5d1d.3e3d9787.496f4.ad@postur.simnet.is>

On Sunday 02 February 2003 05:11 pm, gummi7@simnet.is wrote:
> Hello
>
> I'm a linux/iptables/netfilter newbie, but I want to ask you a simple
> question. It's a long story and unrellevant to tell you why I want to
> do it so i'll just get straigt to the point.
>
> I want to be able to measure(with my linux router) all the traffic
> from the computers on my network that go thrugh a specifc IP number
> wich is located in another place in my country. That is, if a computer
> on my network accesses a website and goes trough a specifed IP number
> to get that website, I want to be able to measure the amount of data
> that goes trough that specified IP number, but only the data on my
> behalf. Note that I do not have phisical(nor telnet or ssh) access to
> the router with the specifed IP number that I want to measure.
>
> Can I do that with iptables and/or ipfilter? A yes is all I have to
> hear if that is possible but an example or a little help wouldn't hurt

If you mean that the specific IP is the destination of a packet, IE 
machines explicitly connect to that IP and it is listed in the header, 
there is no problem.  If you mean that the specific IP is simply a 
router somewhere that the traffic 'might happen' to pass through in its 
travels, I think you're out of luck.

You can tally all traffic to a specific destination IP with:

/sbin/iptables -d w.x.y.z

at the top of your FORWARD chain, and then "iptables -L -v -n" will list 
your rules, and this 'do-nothing' rule will list packet counts and byte 
totals that matched it without actually having DONE anything.  Adding 
'-j LOG --log-prefix "HIT:"' to the end of the above rule would log 
information on ALL packets with that IP as destination, but if this is a 
large amount of traffic then your /var/log/messages (default) logfile 
would chew up hard drive space at an apalling rate.

j



  reply	other threads:[~2003-02-06  5:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-02 22:11 Measuring traffic that goes thrugh a specific IP gummi7
2003-02-06  5:39 ` Joel Newkirk [this message]
2003-02-06 12:33   ` gummi7
2003-02-10  0:32     ` Joel Newkirk
2003-02-11 23:34       ` gummi7
  -- strict thread matches above, loose matches on Subject: below --
2003-02-05 20:49 Khanh Tran

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200302060039.58779.netfilter@newkirk.us \
    --to=netfilter@newkirk.us \
    --cc=gummi7@simnet.is \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox