LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 03-07-2006, 04:12 PM   #1
Technoslave
Member
 
Registered: Dec 2003
Location: Northern VA
Posts: 493

Rep: Reputation: 30
How to reset network stats


Is there a way to reset the ifconfig stats under linux, or the netstat -s type stats.

Thanks,

Bonus question, anyone recall how to do this under Solaris?
 
Old 03-08-2006, 09:00 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
If your nic's driver is loaded as a module in the kernel then:
Code:
ifconfig ethX down
modprobe -r <module>
modprobe <module>
ifconfig ethX up
would do the job. If you have built the driver in the kernel I guess rebooting is the only solution.
As for solaris perhaps the following should do the job
Code:
ifconfig hmeX down
ifconfig hmeX unplumb
ifconfig hmeX plumb
ifconfig hmeX up
Else again rebooting should work
 
Old 03-08-2006, 11:52 AM   #3
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
but isn't there a way to do it without bringing the link down or rebooting?? just curious...
 
Old 03-09-2006, 01:50 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
but isn't there a way to do it without bringing the link down or rebooting?? just curious...
You can always mess with /proc/net/dev which is the file that keeps the stats
 
Old 03-09-2006, 02:12 PM   #5
Technoslave
Member
 
Registered: Dec 2003
Location: Northern VA
Posts: 493

Original Poster
Rep: Reputation: 30
Yeah, with Solaris it was just a one line command, I found it once, and it didn't bring the interface down, and it's just something on the periphery. I'm mostly interested in a linux command to do this, and bringing the interface down isn't really an option.

Yeah, I've thought about messing with /proc and try to 0 everything out, but wanted to avoid that if I could.
 
  


Reply



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
Crash, reset, and network card failure timelord726 Linux - Newbie 3 08-12-2004 11:25 AM
writing c code for getting stats from a network card h/w Programming 2 10-01-2003 12:51 PM
reset stats Tinkster LQ Suggestions & Feedback 3 08-07-2003 01:09 PM
Network Error: Connection Reset by Peer Bob Welch Linux - Networking 3 12-09-2002 01:07 PM
how do I reset the IRQ of my network card? Admiral Yoshi Linux - Networking 2 05-15-2002 10:02 PM

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

All times are GMT -5. The time now is 09:33 AM.

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
Open Source Consulting | Domain Registration