From owner-freebsd-questions@FreeBSD.ORG Fri Jan 22 10:31:59 2010 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 90C8B106566C for ; Fri, 22 Jan 2010 10:31:59 +0000 (UTC) (envelope-from fbsd1@a1poweruser.com) Received: from mail-03.name-services.com (mail-03.name-services.com [69.64.155.195]) by mx1.freebsd.org (Postfix) with ESMTP id 7CE068FC0C for ; Fri, 22 Jan 2010 10:31:59 +0000 (UTC) Received: from [10.0.10.3] ([202.69.174.13]) by mail-03.name-services.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 22 Jan 2010 02:31:57 -0800 Message-ID: <4B597E97.7060807@a1poweruser.com> Date: Fri, 22 Jan 2010 18:31:51 +0800 From: Fbsd1 User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: FreeBSD Questions References: <4B594FC0.3010200@el.net> <4B5973AD.8070603@locolomo.org> In-Reply-To: <4B5973AD.8070603@locolomo.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 22 Jan 2010 10:31:59.0205 (UTC) FILETIME=[20B64150:01CA9B4E] X-Sender: fbsd1@a1poweruser.com Subject: Re: pf rules 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: Fri, 22 Jan 2010 10:31:59 -0000 Erik Norgaard wrote: > kalin m wrote: >> tcp_in = "{ www, https }" >> ftp_in = "{ ftp }" >> udp = "{ domain, ntp }" >> ping = "echoreq" >> >> set skip on lo >> scrub in >> >> antispoof for eth0 inet >> >> block in all >> pass out all keep state >> pass proto udp to any port $udp >> pass inet proto icmp all icmp-type $ping keep state >> pass in inet proto tcp to any port $tcp_in flags S/SAF synproxy state >> pass proto tcp to any port ssh > > To debug pf rules: > > - always add direction to the rule, pass or block, add interface to all > rules except default policy, keep state on all pass rules > - group your rules per direction, then per interface > - add log to all rules and watch pflog to see which rule blocks or > passes traffic. > - use keyword quick for any decisive rule > - check the parsing of your ruleset, pfctl -sr > > then come back and ask for help. > > BR, Erik > > See sample pf firewall rules in manual