From owner-freebsd-net@FreeBSD.ORG Thu Jul 13 18:54:21 2006 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8C0CF16A4E2 for ; Thu, 13 Jul 2006 18:54:21 +0000 (UTC) (envelope-from dmitry@atlantis.dp.ua) Received: from postman.atlantis.dp.ua (postman.atlantis.dp.ua [193.108.47.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id E458F43D45 for ; Thu, 13 Jul 2006 18:54:19 +0000 (GMT) (envelope-from dmitry@atlantis.dp.ua) Received: from smtp.atlantis.dp.ua (smtp.atlantis.dp.ua [193.108.46.231]) by postman.atlantis.dp.ua (8.13.1/8.13.1) with ESMTP id k6DIs46g099577; Thu, 13 Jul 2006 21:54:04 +0300 (EEST) (envelope-from dmitry@atlantis.dp.ua) Date: Thu, 13 Jul 2006 21:54:04 +0300 (EEST) From: Dmitry Pryanishnikov To: Brian Candler In-Reply-To: <20060712083020.GA2607@uk.tiscali.com> Message-ID: <20060713214311.T73434@atlantis.atlantis.dp.ua> References: <20060712083020.GA2607@uk.tiscali.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-net@freebsd.org, Ensel Sharon Subject: Re: counting (not) blocks of IPs in ipfw - please help X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2006 18:54:21 -0000 Hello! On Wed, 12 Jul 2006, Brian Candler wrote: > Firstly, "from any XXX" is giving two different 'from' items. I guess you > meant "from not { 10.20.0.0/16 or 10.30.0.0/16 }". But that doesn't work > either: > > # ipfw add 00100 count ip from not { 10.20.0.0/16 or 10.30.0.0/16 } to any > via fxp0 in > ipfw: hostname ``{'' unknown > > ... > The obvious boolean transformation doesn't work, since "and" is not allowed > either: i.e. > > # ipfw add 00100 count ip from { not 10.20.0.0/16 and not 10.30.0.0/16 } to > any via fxp0 in > ipfw: missing ")" Correct, there is no 'and' keyword in ipfw syntax, since it's redundant: a simple ',' in address list means 'and'. So this can be written as: ipfw add 100 count ip from not 10.20.0.0/16,10.30.0.0/16 to any via fxp0 in since 'not' in the src and dst definitions refers to the whole list: addr: [not] {any | me | me6 table(number[,value]) | addr-list | addr-set} (an '|' is missing between 'me6' and 'table...' here, isn't it?) Sincerely, Dmitry -- Atlantis ISP, System Administrator e-mail: dmitry@atlantis.dp.ua nic-hdl: LYNX-RIPE