[PLUG] how to get byte,packet counts on aliased interfaces?

Chris Jantzen chris-plug at maybe.net
Sat Nov 22 22:57:02 UTC 2003


On Sat, Nov 22, 2003 at 10:18:50PM -0800, Russell Senior wrote:
> 
> It appears most traffic counting tools look at /proc/net/dev, e.g.:
>
> [...]
> 
> However, I've got one of the ethN devices aliased across several IP
> addresses, but no obvious way to get specific stats from each of them.
> Anyone know the best way (or any good way (... or any bad way!)) to do
> that?

The best way, afaik, is to use pass-through rules in iptables, and get
statistics from there. Inspect "iptables -L -n -v", you'll notice packet/
byte counts per rule passed through. Just create a rule with -i and/or
-o parameters for the interface and/or alias in question with no action,
and it will count for you.

-- 
chris kb7rnl =->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.pdxlinux.org/pipermail/plug/attachments/20031122/2466d528/attachment.asc>


More information about the PLUG mailing list