LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-11-2004, 04:55 PM   #1
sheyh
LQ Newbie
 
Registered: Jul 2004
Posts: 1

Rep: Reputation: 0
Question iptables traffic accounting for each IP/MAC


hi all,

how to count traffic for each IP/MAC in my network with iptables/linux gateway.

e.g.:

iptables -N clients
iptables -A FORWARD -j clients

iptables -A clients -s 192.168.0.24 -m mac --mac-source 00:30:1B:AB:F6:83
iptables -A clients -s 192.168.0.25 -m mac --mac-source 00:30:1B:AB:F6:84


but then if I download 1.2meg file on 192.168.0.24 I get:

bash-2.05b# iptables -L FORWARD -vn
Chain FORWARD (policy ACCEPT 7045 packets, 6258K bytes)
pkts bytes target prot opt in out source destination
1408 1251K clients all -- * * 0.0.0.0/0 0.0.0.0/0

total FORWARD is OK, but it's total for all clients not only 192.168.0.24

bash-2.05b# iptables -L clients -vn
Chain clients (1 references)
pkts bytes target prot opt in out source destination
553 22411 all -- * * 192.168.0.24 0.0.0.0/0 MAC 00:30:1B:AB:F6:83
0 0 all -- * * 192.168.0.25 0.0.0.0/0 MAC 00:30:1B:AB:F6:84

and chain clients shows 22411bytes for this client (192.168.0.24). How can I count traffic for each client and not only total.

Thanks!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
IP Traffic accounting varun_saa Mandriva 0 02-26-2005 05:13 AM
IP-Accounting by iptables? TobyD Linux - Networking 2 11-15-2004 06:59 PM
traffic accounting? how? sciobanu Linux - Networking 4 07-08-2004 11:09 AM
iptables accounting rules petrax Linux - Networking 1 11-10-2003 09:09 PM
Traffic accounting...? Gorbachov Linux - Software 2 09-23-2003 07:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration