[TriLUG] Reset conuters on eth interface

Mike Mueller mjm-58 at mindspring.com
Wed Sep 11 09:45:16 EDT 2002


On Tuesday 10 September 2002 16:35, Jon Carnes wrote:
> I think we tried to hunt this one down a couple of years ago and at that
> time we came up blank.  The only way to reset those values was to
> reboot. Starting and stopping the network does not clear the stats.

1. lsmod // note driver for eth0, pcnet_cs for this example
2. ifconfig // note counters
3. ifdown eth0
4. rmmod pcnet_cs
5. ifconfig // note eth0 is gone
6. insmod pcnet_cs
7. ifup eth0
8. ifconfig // note counters have been reset

modify procedure if more than one eth if is using the dr

>
> The stats are stored in /proc/net/dev. You can read this file, but not
> write to it.
>
> I wrote some packages to watch my firewalls and they recorded the number
> of packets per hour to cross in and out of the machine.  For that I
> simply stored the hourly numbers and subtracted one hours numbers from
> the last hours numbers.  That worked fine.
>
> IPChains will let you record the same information, and reset it's
> counter whenever you like. If its necessary to you to have something
> that you can reset to zero, then turn on your accounting in IPChains (or
> IPTables).
>
> Jon
> ===
>
> On Tue, 2002-09-10 at 08:32, Jeff Bollinger wrote:
> > Does anyone know how to reset the counters on a particular ethernet
> > interface?  For example,
> >
> > ifconfig eth1
> > eth1      Link encap:Ethernet  HWaddr 00:04:75:B0:07:14
> >            BROADCAST MULTICAST  MTU:1500  Metric:1
> >            RX packets:7664356 errors:0 dropped:0 overruns:1 frame:0
> >            TX packets:6424 errors:0 dropped:0 overruns:0 carrier:0
> >            collisions:0 txqueuelen:100
> >            RX bytes:1089057890 (1038.6 Mb)  TX bytes:405296 (395.7 Kb)
> >            Interrupt:9 Base address:0x7880
> >
> > How can I zero out the "RX bytes" and the "TX bytes" portions above?
> >
> > Thanks,
> > Jeff
> >
> > --
> > Jeff Bollinger
> > University of North Carolina
> > IT Security Analyst
> > 105 Abernethy Hall
> > mailto: jeff_bollinger at unc dot edu
> >
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.0.6 (GNU/Linux)
> > Comment: For info see http://www.gnupg.org
> >
> > iEYEARECAAYFAjzETQsACgkQvoVlxVBmgsXunQCg1Pjc14nTjWiP8FCy+NNDK97E
> > HMAAoIRhikBeM5Lm+6Iu/0h3MX6lDgiR
> > =LpiV
> > -----END PGP SIGNATURE-----
> >
> > _______________________________________________
> > TriLUG mailing list
> >     http://www.trilug.org/mailman/listinfo/trilug
> > TriLUG Organizational FAQ:
> >     http://www.trilug.org/~lovelace/faq/TriLUG-faq.html
>
> _______________________________________________
> TriLUG mailing list
>     http://www.trilug.org/mailman/listinfo/trilug
> TriLUG Organizational FAQ:
>     http://www.trilug.org/~lovelace/faq/TriLUG-faq.html

-- 
mueller, mike

The larger purpose of the economic order, including Wall Street, is to 
support the material conditions for human existence, not to undermine and 
destabilize them.

-Editorial, The Nation, August 19, 2002



More information about the TriLUG mailing list