From owner-freebsd-questions@FreeBSD.ORG Wed Feb 13 20:35:44 2013 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E9D7623A for ; Wed, 13 Feb 2013 20:35:44 +0000 (UTC) (envelope-from jguojun@sbcglobal.net) Received: from nm29.access.bullet.mail.mud.yahoo.com (nm29.access.bullet.mail.mud.yahoo.com [66.94.237.94]) by mx1.freebsd.org (Postfix) with ESMTP id 7D274E11 for ; Wed, 13 Feb 2013 20:35:44 +0000 (UTC) Received: from [66.94.237.200] by nm29.access.bullet.mail.mud.yahoo.com with NNFMP; 13 Feb 2013 20:35:38 -0000 Received: from [66.94.237.103] by tm11.access.bullet.mail.mud.yahoo.com with NNFMP; 13 Feb 2013 20:35:38 -0000 Received: from [127.0.0.1] by omp1008.access.mail.mud.yahoo.com with NNFMP; 13 Feb 2013 20:35:38 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 10463.4050.bm@omp1008.access.mail.mud.yahoo.com Received: (qmail 29374 invoked by uid 60001); 13 Feb 2013 20:35:37 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sbcglobal.net; s=s1024; t=1360787737; bh=sWN8kWQtWn6QDU3Iu197tlPb92RcWHEk9cIXpxJ5stM=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:Message-ID:Date:From:Subject:To:MIME-Version:Content-Type; b=QHMYcqtghaRTCELFuv/v8ktTpB4xA8byUm7Z/t5RcDJAUTT4ittAMMAjA65gkEWFru2wb/VBJ3WpmW8RwDiPvWeP/gz0q2xMg+rnGLmoQhtEq/6oZ3pAVbzRY/Za7rWt3heoY/jH9+9HciPJ96Kmas80zGDMcBZTJosvh47CGlI= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=sbcglobal.net; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:Message-ID:Date:From:Subject:To:MIME-Version:Content-Type; b=yR6daj3ic8JdP3yJcp2lLxRs+OgE9xK+QbzLhNTHnhDUh2K7Utu/TATDotANdbnqMWELHJrMQA0EGz/Q4p6VO/hOdiIphJRW9Ou1EeL4/4f9GdpHNp708yyBZRP6KlLzgGpPpEjdxKRIiwB7/phXU6rfW7aeZZwcaV+2egJBQ7c=; X-YMail-OSG: IimH9WIVM1mVc39LSk7WD6wH5__ujH9r12.ux29O2nt_S8h oSVjFjHx6Q_LoTx6FlYRtl11jUzjUXmAaxGF2k9VvPHNeSyMOeEK1lAZhpf1 Pg_odIBI00Pv2IADRWtbVeLk7EEWJDDLecBvEgyOaPwJWZbCIalZmOYDP8NO .iH545uyQ0znXRQ_F6AcHiHdvHqKCWAlGsQFNzALJ62.7.3jO4oXOs1u8bDK d4ms5ntsR58423xvIPGvm.PkhqANZABPsbaLZ.rXWO6zobaO.liOQgcwII6X PnaqfygXdVDvsjLGawQBbehxe.GxgOE4JZLpzslno76mFwYHx5UBDlrO4E1O aJkoAyxNFxrF9EeN1NNOcTWNBCeDjXD1vT41mOGTclhneM8QXUd5pqfA7cXE QTAPQzN0iHk3PKcrgFPINzwC4T0irv3LysDlTXs5irHOLqz..r2nFSCO4Ljt qzYWqceIDc14LzMCEKeQ52msbTqGjro0RGvQuEKG1mhvL9vCBJoA_okcSC9S Z4vi0_LKr310gVekNAD28lginxx2Ruwvqe3cY4X4HEwCClftg2qTb3RwvGF9 4YV5sNRDmFzMv4TC7vRtGY4QgV6JIwzMrBjMqRvaNz1zLgoN5n5vn66wRqXG 7HINa.HTG68hdMf84A7AmB74lNtR9fczxlndh1RKNDp2bnbhON3HwyoFOLvI 46SwntZdpGjazZyK3A5HbvGwFkAptlIpf31CNwCZXhZfFuEorD5P13fkVsFa b_ZKLQ5AYJgyrkOR9870- Received: from [199.106.103.55] by web180906.mail.ne1.yahoo.com via HTTP; Wed, 13 Feb 2013 12:35:37 PST X-Rocket-MIMEInfo: 001.001, VGhpcyBpcyA4LjMtUmVsZWFzZSBvbiBhIEhQIEVsaXRlQm9vayA4NDYwcCAoNC1jb3JlIGk1KSB3aXRoIGFuIG9uIGJvYXJkIEludGVsIAooZW0wKSBpbnRlcmZhY2UuCldoZW4gYXR0YWNoZWQgYSBUcmVuZGVudCBUVTItRVQxMDAgVVNCIEV0aGVyIGRvbmdsZSBmb3IgYSBzZWNvbmQgaW50ZXJmYWNlLCBpdCAKaGFzIG5vIHByb2JsZW0gdG8gdGFsayB0byB0aGUgbG9jYWwgbmV0d29yayAoMTAuMjM0LjM3LjAvMjQpLCBidXQgaXQgaGFzIHByb2JsZW0gCnRvIHRhbGsgdG8gYSByZW1vdGUgbmV0d29yayBvciABMAEBAQE- X-Mailer: YahooMailRC/718 YahooMailWebService/0.8.133.508 Message-ID: <1360787737.17354.YahooMailRC@web180906.mail.ne1.yahoo.com> Date: Wed, 13 Feb 2013 12:35:37 -0800 (PST) From: Jin Guojun Subject: Why ue0 do ARP on non local address when using static route? To: questions freebsd MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Feb 2013 20:35:45 -0000 This is 8.3-Release on a HP EliteBook 8460p (4-core i5) with an on board Intel (em0) interface. When attached a Trendent TU2-ET100 USB Ether dongle for a second interface, it has no problem to talk to the local network (10.234.37.0/24), but it has problem to talk to a remote network or host (10.227.148.0/24) via eu0 interface. When a remote host ping this host or this host ping that remote host, ARP request is always showing up. A static route is set and remote host is no part of the local sub net, why ARP is going on? Is any sysctl parameter can fix this problem? -Jin Internet: Destination Gateway Flags Refs Use Netif Expire default 10.234.16.1 UGS 0 2841993 em0 10.227.148.52 10.234.37.80 UHS 0 26 ue0 10.234.16.0/22 link#1 U 0 0 em0 10.234.17.41 link#1 UHS 0 0 lo0 10.234.37.0/24 link#8 U 0 3 ue0 10.234.37.80 link#8 UHS 0 0 lo0 127.0.0.1 link#7 UH 0 492 lo0 ue0: flags=8843 metric 0 mtu 1500 options=80008 ether 00:50:b6:00:a4:91 inet 10.234.37.80 netmask 0xffffff00 broadcast 10.234.37.255 media: Ethernet autoselect (100baseTX ) status: active ping from 10.227.148.52 12:16:37.924425 IP 10.227.148.52 > 10.234.37.80: ICMP echo request, id 21002, seq 1, length 64 12:16:37.924442 ARP, Request who-has 10.227.148.52 tell 10.234.37.80, length 28 12:16:38.931919 IP 10.227.148.52 > 10.234.37.80: ICMP echo request, id 21002, seq 2, length 64 12:16:38.931937 ARP, Request who-has 10.227.148.52 tell 10.234.37.80, length 28 12:16:39.931662 IP 10.227.148.52 > 10.234.37.80: ICMP echo request, id 21002, seq 3, length 64 12:16:39.931680 ARP, Request who-has 10.227.148.52 tell 10.234.37.80, length 28 12:16:40.931656 IP 10.227.148.52 > 10.234.37.80: ICMP echo request, id 21002, seq 4, length 64 12:16:40.931674 ARP, Request who-has 10.227.148.52 tell 10.234.37.80, length 28 12:16:41.931519 IP 10.227.148.52 > 10.234.37.80: ICMP echo request, id 21002, seq 5, length 64 12:16:41.931533 ARP, Request who-has 10.227.148.52 tell 10.234.37.80, length 28 12:16:42.931643 IP 10.227.148.52 > 10.234.37.80: ICMP echo request, id 21002, seq 6, length 64 ping to 10.227.148.52 12:16:42.931661 ARP, Request who-has 10.227.148.52 tell 10.234.37.80, length 28 12:16:59.724724 ARP, Request who-has 10.227.148.52 tell 10.234.37.80, length 28 12:17:00.725715 ARP, Request who-has 10.227.148.52 tell 10.234.37.80, length 28 12:17:01.725883 ARP, Request who-has 10.227.148.52 tell 10.234.37.80, length 28 12:17:02.726690 ARP, Request who-has 10.227.148.52 tell 10.234.37.80, length 28 12:17:03.727677 ARP, Request who-has 10.227.148.52 tell 10.234.37.80, length 28 ^C 45 packets captured 1557 packets received by filter From owner-freebsd-questions@FreeBSD.ORG Wed Feb 13 21:08:43 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EEED5A62 for ; Wed, 13 Feb 2013 21:08:43 +0000 (UTC) (envelope-from bonomi@mail.r-bonomi.com) Received: from mail.r-bonomi.com (mx-out.r-bonomi.com [204.87.227.120]) by mx1.freebsd.org (Postfix) with ESMTP id 6E759F5F for ; Wed, 13 Feb 2013 21:08:42 +0000 (UTC) Received: (from bonomi@localhost) by mail.r-bonomi.com (8.14.4/rdb1) id r1DLD6DX003167; Wed, 13 Feb 2013 15:13:06 -0600 (CST) Date: Wed, 13 Feb 2013 15:13:06 -0600 (CST) From: Robert Bonomi Message-Id: <201302132113.r1DLD6DX003167@mail.r-bonomi.com> To: tundra@tundraware.com Subject: Re: Fun Scripting Problem In-Reply-To: <511BDB13.3060005@tundraware.com> Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Feb 2013 21:08:44 -0000 > Date: Wed, 13 Feb 2013 12:27:31 -0600 > From: Tim Daneliuk > Subject: Fun Scripting Problem > > I know how to do this in Python, but I really want to do it in > straight Bourne shell. I have some ideas, but I thought I'd > give you folks a crack at this Big Fun: > > a) You have a directory of files - say they're logs - generated > at nondeterministic intervals. You may get more than one a day, > more than one a month, none, or hundreds. > > b) To conserve space, you want to keep the last file generated > in any given month (the archive goes back for an unspecified > number of years), and delete all the files generated prior to > that last file in that same month. > > c) Bonus points if the problem is solved generally for either files > or directories generated as described above. > > These are not actually logs, and no, I don't think logrotate can > do this ... or can it? here's a one-liner: rm ` \ stat -f "%SB %B %N" * \ | sort -k5nr \ | cut -c1-7,17-20,32- \ | awk 'BEGIN {a="";b=0;c=0} $1==a && $2==b && $3=c {print $4;}{a=$1;b=$2;c=$3}' \ ` This selects on creation date. change the B (both of them) in the stat call to use a different timestamp