From owner-freebsd-pf@FreeBSD.ORG Mon Oct 27 16:30:59 2014 Return-Path: Delivered-To: freebsd-pf@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CDA362A9; Mon, 27 Oct 2014 16:30:59 +0000 (UTC) Received: from mail-wg0-x22b.google.com (mail-wg0-x22b.google.com [IPv6:2a00:1450:400c:c00::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 42003EA6; Mon, 27 Oct 2014 16:30:59 +0000 (UTC) Received: by mail-wg0-f43.google.com with SMTP id n12so6117632wgh.14 for ; Mon, 27 Oct 2014 09:30:57 -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=zdoML7ABKSsvVaKNhzUzPUaiXHeNdWSA5U4B/4h17DQ=; b=w+HjWLAsIaCdiLsSc2p2PgHkcdXhieyU1v00ZNJZuu/WHWncaD4LSuyu5HxUzlhc25 7tCXKncitPOnHsAgEOoDtswX9iPBmsepaxwKNKVtiki2LHcXvn0qn5YuFBXYcbM9/0AQ ANyg8rf+HnHvoK8aJwVMhvz6T9jbDeRlQb3F9/90AHj71Mcg504Jamtcp42iXgl269Ff swKgBMSQ7NQqcrZnkZeXG8/9B6EK6/+7baG00yuwXlVCOZhLJOOFfBhfZqPr/niknylP rCdIo9okcRuyVFjAx06yQRYOkOW48GCOPMcx4babvLuog3bKamrnFjyC0Ges4SRvuPq8 0X8w== MIME-Version: 1.0 X-Received: by 10.194.243.164 with SMTP id wz4mr3284151wjc.129.1414427457630; Mon, 27 Oct 2014 09:30:57 -0700 (PDT) Received: by 10.194.223.1 with HTTP; Mon, 27 Oct 2014 09:30:57 -0700 (PDT) In-Reply-To: <20141027162433.GB6851@in-addr.com> References: <20141027162433.GB6851@in-addr.com> Date: Mon, 27 Oct 2014 17:30:57 +0100 Message-ID: Subject: Re: How to block IP range From: Cristiano Deana To: Gary Palmer Content-Type: text/plain; charset=UTF-8 Cc: "freebsd-pf@freebsd.org" X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 16:30:59 -0000 On Mon, Oct 27, 2014 at 5:24 PM, Gary Palmer wrote: Hi >> For example, I need to block only 100 IPs in the range: 10.0.0.1-10.0.0.100 > tables? > > you can do things like > > table persist file "/etc/pf/blocked_hosts.table" > block in quick log on $ext_if_ipv4 from to any I'm adding the fast way to build the file: sh -c 'for ip in `jot 100 1 100`; do echo 10.0.0.$ip >> /etc/pf/blocked_hosts.table; done' -- Cris, member of G.U.F.I Italian FreeBSD User Group http://www.gufi.org/