From: " Tobias Geiger" <tobias.geiger@web.de>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] reset /proc/net/dev
Date: Thu, 12 Sep 2002 12:20:05 +0000 [thread overview]
Message-ID: <marc-lartc-103183330825720@msgid-missing> (raw)
In-Reply-To: <marc-lartc-103183079823433@msgid-missing>
Hi,
perhaps the only way (although untested) may be to "ip link set
<interface> down" and to "rmmod <according-kernel-module>"
which is in my opinion impractible :)
much nicer and easier:
create a simple rule matching everything incoming/outgoing your desired
device and insert it in the PREROUTING/POSTROUTING chain. (or a custom
rule to which is jumped in INPUT and FORWARD / OUTPUT and FORWARD)
e.g.
iptables -t nat -I PREROUTING -i eth0 # for incoming
iptables -t nat -I POSTROUTING -o eth0 # for outgoing
or if u prefer not to use the nat table
e.g.
iptables -N eth0_out
iptables -N eth0_in
iptables -I INPUT -i eth0 -j eth0_in
iptables -I FORWARD -i eth0 -j eth0_in
iptables -I FORWARD -o eth0 -j eth0_out
iptables -I INPUT -o eth0 -j eth0_out
with "iptables -t nat -L -vx" / "iptables -L -vx" u can read
bytes/packets and process this output in your script
hope that helps....
tobias
>
> HI List,
> How do i reset the values in /proc/net/dev ?
> This file holds values for count of each (packet && byte),
> (sent && received) through all interfaces.
>
> I'm using a monitor which reads values from this
> file and prints out some nicely formatted output.
>
> But i need to reset the values. ie. set then to zero.
> Restarting the network does not do what i want.
> I guess a reboot should do it.
>
> Any other way?
>
> --
> arc_of_descent
> _______________________________________________
> LARTC mailing list / LARTC@mailman.ds9a.nl
> http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
next prev parent reply other threads:[~2002-09-12 12:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-12 11:54 [LARTC] reset /proc/net/dev Rohan Almeida
2002-09-12 12:20 ` Tobias Geiger [this message]
2002-09-12 12:48 ` Rohan Almeida
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=marc-lartc-103183330825720@msgid-missing \
--to=tobias.geiger@web.de \
--cc=lartc@vger.kernel.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