From owner-freebsd-questions@FreeBSD.ORG Mon Sep 17 14:05:11 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A53C516A420 for ; Mon, 17 Sep 2007 14:05:11 +0000 (UTC) (envelope-from agus.262@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.177]) by mx1.freebsd.org (Postfix) with ESMTP id 4BCA213C46E for ; Mon, 17 Sep 2007 14:05:11 +0000 (UTC) (envelope-from agus.262@gmail.com) Received: by py-out-1112.google.com with SMTP id u77so3184013pyb for ; Mon, 17 Sep 2007 07:04:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=hx4V0OgvVbBolS14TsTuETybfn5T+9byKKe0N/vFkXM=; b=T3da876WmgFGPxE52sy9++1LmMCT06SH7TL1o6g0+f144Hl+RmXzysUARY6qUdSZYWZrZhwo3MFfZT2Bg3+ev7aTXanxwKjZ0xZpwerhQDbtBBtbqeT3CNE1I/pHtimAEQyznXDnGwYUnM7QjvhMjkfLPqIDde65IJSQNGdvbN4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=ohwtif2G/QUhiwW2JCOKm68PMFN1ib7EFi8MLHGhUCwX7i0cv+k/x3mTpwfApmfA6RjiqpKeyLfOQ9MYUSSesE+dzVu8n7qE/Go5QsyO3RCxLCFJ7pJf640xa4rLm773aJ6qqwRVyOC46KcE+dw5d8qCkH4sf0QkKlGjHLYE3wg= Received: by 10.35.21.9 with SMTP id y9mr6371397pyi.1190037896737; Mon, 17 Sep 2007 07:04:56 -0700 (PDT) Received: by 10.35.83.16 with HTTP; Mon, 17 Sep 2007 07:04:56 -0700 (PDT) Message-ID: Date: Mon, 17 Sep 2007 11:04:56 -0300 From: Agus To: Mel In-Reply-To: <200709152336.27214.fbsd.questions@rachie.is-a-geek.net> MIME-Version: 1.0 References: <200709152336.27214.fbsd.questions@rachie.is-a-geek.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-questions@freebsd.org Subject: Re: How to add rule with pfctl... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2007 14:05:11 -0000 2007/9/15, Mel : > > On Saturday 15 September 2007 23:18:17 Agus wrote: > > > I am trying to figure out how to add a firewall rule with pfctl... > > This is what i'm trying to do... > > > > I've got SEC that matches certain pattern and takes the IP from that and > > want to trigger a firewall rule to block that IP.... > > Then after a couple of hours SEC will trigger the command to un-block > the > > IP... > > So what i need is the command to block an IP address from command line, > not > > touching any pf.conf.... > > If you don't need to add a rule but an IP, then tables are your friend. > Example for /etc/pf.conf: > # Placeholder for spammers table, non-routable network IP. > table persist { 192.168.111.111 } > # Block this traffic > block return-rst in log on $ext_if proto tcp from port smtp > > Then on the command line: > /sbin/pfctl -t spammers -Tadd ip.from.new.spammer > And to delete: > /sbin/pfctl -t spammers -Tdel ip.from.old.spammer > > -- > Mel > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to " > freebsd-questions-unsubscribe@freebsd.org" > Great...Thanks Mel, this was what i was looking...although not fot spammers but for ssh brute-force attacks detected by SEC.... Very nice... See ya PS: Question...Is there a log where i can look if pf is down, so i can check with SEC...? thanks