From owner-freebsd-net@FreeBSD.ORG Tue Jun 4 15:53:42 2013 Return-Path: Delivered-To: freebsd-net@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 05984D15 for ; Tue, 4 Jun 2013 15:53:42 +0000 (UTC) (envelope-from andrnils@gmail.com) Received: from mail-ob0-x22f.google.com (mail-ob0-x22f.google.com [IPv6:2607:f8b0:4003:c01::22f]) by mx1.freebsd.org (Postfix) with ESMTP id C98F41A1B for ; Tue, 4 Jun 2013 15:53:41 +0000 (UTC) Received: by mail-ob0-f175.google.com with SMTP id xn12so682062obc.34 for ; Tue, 04 Jun 2013 08:53:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=iHVlKxnQIoYpUxrNvkxNDsocTJSoWMurLfvDBbq4NCA=; b=IPCmrwpQKQMAnbIr1UrcvdNCWKb8I9eMkUfgzP8vH7docy9RmeDYLlvjbf2xJOB/nS QKWYJBb7Y7eyqx5ExGqcGXK6BMx35lyK+NAajGYVMROdRrWsG+vyiy+Yx22+CbUZc+0e 9t81PeS849GInxt3AL/aP6vPHgEH3ZKNtP3bU1KG1XFYWmc8pWt76MNCnbF7ZmQ9XDez QZQXXuI+uxsJHBRvwXS678gznKBLXWXVZvPAAzLMOyWZahwvh4kUnbgk4Ci3AgK/8CTP Suu8F2oyqKlenTq67QuMxP7Ny1EALNGCzxksNExDSLbKpSdbzndGglvKxBl4PWfwQ2gR 4nbA== MIME-Version: 1.0 X-Received: by 10.60.125.5 with SMTP id mm5mr12251776oeb.81.1370361221406; Tue, 04 Jun 2013 08:53:41 -0700 (PDT) Received: by 10.76.12.200 with HTTP; Tue, 4 Jun 2013 08:53:41 -0700 (PDT) In-Reply-To: References: Date: Tue, 4 Jun 2013 17:53:41 +0200 Message-ID: Subject: Re: ipfw and tablearg formatting From: Andreas Nilsson To: Michael Sierchio Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: FreeBSD Net X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2013 15:53:42 -0000 On Mon, Jun 3, 2013 at 5:40 PM, Michael Sierchio wrote: > On Mon, Jun 3, 2013 at 4:43 AM, Andreas Nilsson > wrote: > > Hello, > > > > Still trying out the tablearg functionality of ipfw and found the > following: > > > > 1) > > # ipfw table 100 add 192.168.0.0/24 10.0.0.1 > > # ipfw table 100 list > > 192.168.0.0/24 167772161 > > > > I guess it is correct, but not user friendly. Can't the tablearg part be > > printed as normal dotted decimal? > > No - it's an integer. The semantics of the table arg are up to you, > but it could be a rule number, used in a computed go to, as in > > ipfw add 05000 skipto tablearg ip from any to me in recv em1 lookup src-ip > 23 > I use it to classify traffic based on country of origin. > Interesting. So given that table 23 has 1.2.3.4/24 6000 the rule would would be skipto 6000 ip from any to me in recv em1 src-ip 1.2.3.4/24 ? > > > Another question: While using tablearg, is there a way to get statistics > of > > each "individual" computed value instead of just the aggregate > statistics > > for all rules "generated" by the tablearg rule? > > you can log where the target rule is executed, or have a count rule. > > - M > Great, I'll look into that. Best regards Andreas