Hi Michael,

the easiest way I know (which might not be the best one :) is to create a
chain for every user and to route the traffic based on the mac adresses
through the chains ..

something like this:

iptables -N acc_chain_mac1
iptables -A acc_chain_mac1 -j ACCEPT (or if you have any rules put those in
one chain and jump from every accounting chain to this :)

iptables -A FORWARD --mac-source mac_Addr_of_pc1 -j acc_chain_mac1

with iptables -L acc_chain_mac1 -v you can get the traffic which went
through this chain.. now you need only a script which polls all your chains
:)

Another Solution is this (which is very similar :)

you make only a

iptables -A FORWARD --mac-source mac_Addr_of_pc1 -j ACCEPT  (or if you have
any rules put those in one chain and jump from every accounting chain to
this :)

now you can make a iptables -L FORWARD -v

now you get something like

 pkts bytes target               prot opt in     out     source
3        24    ACCEPT        mac                          mac_Addr_of_pc1
4         32    ACCEPT       mac                          mac_Addr_of_pc2

you now only need to write a script to read those lines (the byte and source
section :)

Hope this helps,

and again .. this might be not the easiest/best solution

and sorry for my english

Stefan


----- Original Message -----
From: "Michael Biebl" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 09, 2002 6:19 PM
Subject: Accounting by mac address


> Hi everybody,
>
> does's anybody know how to do traffic accounting by mac addresses under
> linux? I'm currently using iptables to do accounting by IP addresses
> which works fine.
> The problem is that most of our PC's in our network get IP addresses
> assigned per dhcp, so accounting per IP doesn't make much sense.
> Is iptables capable of doing mac address accounting and how do I use it
> then.
>
> Any help appreciated,
>
> Michael
>
> --
> ------------------------------------------------------------
> E-Mail: [EMAIL PROTECTED]
> WWW: http://www.teco.edu/
>
> TecO (Telecooperation Office) Vincenz-Priessnitz-Str.1
> University of Karlsruhe 76131 Karlsruhe, Germany
> ------------------------------------------------------------
>
>
>


Reply via email to