From owner-freebsd-net@FreeBSD.ORG Thu Jan 22 21:35:10 2009 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 410C5106568E for ; Thu, 22 Jan 2009 21:35:10 +0000 (UTC) (envelope-from sclark46@earthlink.net) Received: from elasmtp-mealy.atl.sa.earthlink.net (elasmtp-mealy.atl.sa.earthlink.net [209.86.89.69]) by mx1.freebsd.org (Postfix) with ESMTP id E97308FC20 for ; Thu, 22 Jan 2009 21:35:09 +0000 (UTC) (envelope-from sclark46@earthlink.net) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=dk20050327; d=earthlink.net; b=JsxXbqEfPrh7E5f30r8YuVvfpv9Y8suyz9EN94Ygdl0A0ySqqkwhW6snYAZeSuJz; h=Received:Message-ID:Date:From:Reply-To:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-ELNK-Trace:X-Originating-IP; Received: from [208.118.36.246] (helo=joker.seclark.com) by elasmtp-mealy.atl.sa.earthlink.net with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1LQ7Ce-0002PS-R7; Thu, 22 Jan 2009 16:35:08 -0500 Message-ID: <4978E68B.20100@earthlink.net> Date: Thu, 22 Jan 2009 16:35:07 -0500 From: Stephen Clark User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: Peter References: <54994.216.241.167.212.1232652975.squirrel@webmail.pknet.net> In-Reply-To: <54994.216.241.167.212.1232652975.squirrel@webmail.pknet.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-ELNK-Trace: a437fbc6971e80f61aa676d7e74259b7b3291a7d08dfec797e964abbc0e7d68d82f2c243775f0de2350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c X-Originating-IP: 208.118.36.246 Cc: freebsd-net@freebsd.org Subject: Re: FreeBSD 6.3 clear ethernet interface counter X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: sclark46@earthlink.net List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2009 21:35:10 -0000 Peter wrote: >> Hello, >> >> I googled and didn't find an answer on how to clear the interface stats >> that are >> displayed by >> netstat -ibndh >> >> could someone point in the right direction? >> >> Thanks, >> Steve >> -- >> >> "They that give up essential liberty to obtain temporary safety, >> deserve neither liberty nor safety." (Ben Franklin) >> >> "The course of history shows that as a government grows, liberty >> decreases." (Thomas Jefferson) > > http://www.google.com/search?q=clear+netstat+interface+counters&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a > > $man netstat |grep -B1 -i counter > in and out. If -d is also present, show the number of dropped > packets. If -h is also present, print all counters in human > -- > particular protocol_family, or for a single protocol. If -s is > repeated, counters with a value of zero are suppressed. If > -z is > also present, reset statistic counters after displaying them > Sigh ... you obviously didn't try using the -z option. [root@sclark ~]# netstat -iz Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll rl0 1500 00:e0:7d:9b:f7:a3 10187060 0 2681169 0 0 rl0 1500 192.168.198 192.168.198.50 3567132 - 2582751 - - rl0 1500 10.254.150/24 10.254.150.10 108113 - 75684 - - rl1 1500 00:e0:7d:9b:f7:9d 18584893 0 9470823 1 0 rl1 1500 10.0.128/17 sclark 11450836 - 9461523 - - vr0 1500 00:11:5b:15:5a:4d 9068 0 18004 0 0 vr0 1500 10.3.1/24 10.3.1.1 9068 - 9068 - - plip0 1500 0 0 0 0 0 lo0 16384 6196166 0 6196166 0 0 lo0 16384 your-net localhost 6196154 - 6196154 - - [root@sclark ~]# netstat -iz Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll rl0 1500 00:e0:7d:9b:f7:a3 10187069 0 2681171 0 0 rl0 1500 192.168.198 192.168.198.50 3567136 - 2582753 - - rl0 1500 10.254.150/24 10.254.150.10 108113 - 75684 - - rl1 1500 00:e0:7d:9b:f7:9d 18584947 0 9470852 1 0 rl1 1500 10.0.128/17 sclark 11450884 - 9461552 - - vr0 1500 00:11:5b:15:5a:4d 9068 0 18004 0 0 vr0 1500 10.3.1/24 10.3.1.1 9068 - 9068 - - plip0 1500 0 0 0 0 0 lo0 16384 6196207 0 6196207 0 0 lo0 16384 your-net localhost 6196195 - 6196195 - - also from the man page: netstat -i | -I interface [-abdhntW] [-f address_family] [-M core] [-N system] notice no "-z" -z is for clearing protocol stats. -- "They that give up essential liberty to obtain temporary safety, deserve neither liberty nor safety." (Ben Franklin) "The course of history shows that as a government grows, liberty decreases." (Thomas Jefferson)