* [LARTC] reset /proc/net/dev
@ 2002-09-12 11:54 Rohan Almeida
2002-09-12 12:20 ` Tobias Geiger
2002-09-12 12:48 ` Rohan Almeida
0 siblings, 2 replies; 3+ messages in thread
From: Rohan Almeida @ 2002-09-12 11:54 UTC (permalink / raw)
To: lartc
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/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [LARTC] reset /proc/net/dev
2002-09-12 11:54 [LARTC] reset /proc/net/dev Rohan Almeida
@ 2002-09-12 12:20 ` Tobias Geiger
2002-09-12 12:48 ` Rohan Almeida
1 sibling, 0 replies; 3+ messages in thread
From: Tobias Geiger @ 2002-09-12 12:20 UTC (permalink / raw)
To: lartc
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/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [LARTC] reset /proc/net/dev
2002-09-12 11:54 [LARTC] reset /proc/net/dev Rohan Almeida
2002-09-12 12:20 ` Tobias Geiger
@ 2002-09-12 12:48 ` Rohan Almeida
1 sibling, 0 replies; 3+ messages in thread
From: Rohan Almeida @ 2002-09-12 12:48 UTC (permalink / raw)
To: lartc
Tobias Geiger thus wrote:
> with "iptables -t nat -L -vx" / "iptables -L -vx" u can read
> bytes/packets and process this output in your script
Yes thanx
I've already used iptables for interesting
graphical output of traffic and bandwidth usage
But i just wanted to know how to reset
/proc/net/dev/ cause its been bugging me
for a long time :-)
--
arc_of_descent
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-09-12 12:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-12 11:54 [LARTC] reset /proc/net/dev Rohan Almeida
2002-09-12 12:20 ` Tobias Geiger
2002-09-12 12:48 ` Rohan Almeida
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.