All of lore.kernel.org
 help / color / mirror / Atom feed
From: Henry Baxter <henrybaxter@shaw.ca>
To: netfilter@lists.netfilter.org
Subject: Re: tracking usage by mac address
Date: Mon, 30 Aug 2004 17:34:26 -0700	[thread overview]
Message-ID: <4133C792.9050909@shaw.ca> (raw)
In-Reply-To: <3063e504083013374bd2a909@mail.gmail.com>

Thank you Jose, I'm going to go with parsing the log with C code which I 
wouldn't mind writing - but if you could point me to your source, that 
would be very helpful. From the sounds of your setup George it should 
work great for us here (a tenth of your bandwidth usage!).

This mailing list rocks

Henry Baxter

George Alexandru Dragoi wrote:

>Well, i don't know if you want to log EVERYTHING.
>Remember ip_conntrackworkson streams, so you can log only NEW packets.
>I have like 90 rules with -m mac like those i said before + several
>port forwarding, on a P2 450Mhz, 100mbit internet connections, used a
>lot, almoust all the time at 11MB/s at upload (exactly where those
>rules aremostly hitted), and top says the sys load is arround 40% at
>most when i have full bandwith in use, but i think it is not because
>of the netfilter, but the PCI usage. Traffic at 50% usually needs much
>less CPU, like 5-10%. I also have many other rules for SYN scan
>limiting, bandwith counting, and so on.
>
>On 30 Aug 2004 20:54:36 +0200, Jose Maria Lopez <jkerouac@eresmas.com> wrote:
>  
>
>>El lun, 30 de 08 de 2004 a las 04:42, Henry Baxter escribió:
>>
>>
>>    
>>
>>>Hello,
>>>
>>>I have been reading this list for several months, and I've really
>>>enjoyed learning all that I have, thank you everybody for the
>>>opportunity to listen:)
>>>
>>>Ultimately I am hoping to track the bandwidth usage of about 50 client
>>>computers through my router based on their MAC address. I understand
>>>that by simply writing a rule that does nothing to the packet, such as
>>>'iptables -A FORWARD -m <mac address>' I can parse the netfilter log and
>>>find out what I need. This seems rather convoluted though - getting
>>>netfilter to create a basically human readable log file, and then
>>>parsing it.
>>>
>>>All of the network traffic is passing through unmanaged switches until
>>>finally hitting the interface on the router.
>>>
>>>I'm sure this must have been done by many others before, so could
>>>anybody give me some idea of what the most common way to handle this
>>>situation would be?
>>>
>>>I appreciate any input.
>>>
>>>Henry Baxter
>>>      
>>>
>>If you don't have a big number of users you can do something like this:
>>
>>iptables -N MACSTATS
>>iptables -A INPUT -j MACSTATS
>>iptables -A OUTPUT -j MACSTATS
>>iptables -A FORWARD -j MACSTATS
>>iptables -A MACSTATS -m mac --mac-source $CLIENT1_MAC_ADDRESS -j RETURN
>>iptables -A MACSTATS -m mac --mac-source $CLIENT2_MAC_ADDRESS -j RETURN
>>...
>>
>>So you can read the data transfered by each client with the command:
>>iptables -L MACSTATS -nv
>>
>>More or less this is what we do in our bastion-firewall-stats module
>>from our bastion-firewall GPL firewall, but we extract the counters with
>>C code to put it in a rrdtool database and then create graphs with the
>>data. If need code you can look at the source code of this addon from
>>our firewall.
>>
>>--
>>Jose Maria Lopez Hernandez
>>Director Tecnico de bgSEC
>>jkerouac@bgsec.com
>>bgSEC Seguridad y Consultoria de Sistemas Informaticos
>>http://www.bgsec.com
>>ESPAÑA
>>
>>The only people for me are the mad ones -- the ones who are mad to live,
>>mad to talk, mad to be saved, desirous of everything at the same time,
>>the ones who never yawn or say a commonplace thing, but burn, burn, burn
>>like fabulous yellow Roman candles.
>>                -- Jack Kerouac, "On the Road"
>>
>>
>>    
>>
>
>
>  
>




  reply	other threads:[~2004-08-31  0:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-30  2:42 tracking usage by mac address Henry Baxter
2004-08-30 10:17 ` Chris Brenton
2004-08-30 11:34 ` Torsten Luettgert
2004-08-30 13:12   ` George Alexandru Dragoi
2004-08-30 18:54 ` Jose Maria Lopez
2004-08-30 20:37   ` George Alexandru Dragoi
2004-08-31  0:34     ` Henry Baxter [this message]
2004-08-31 19:52       ` Jose Maria Lopez
2004-08-31 19:52     ` Jose Maria Lopez

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=4133C792.9050909@shaw.ca \
    --to=henrybaxter@shaw.ca \
    --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 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.