From owner-freebsd-questions@FreeBSD.ORG Tue Mar 22 12:21:05 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0806016A4CE for ; Tue, 22 Mar 2005 12:21:05 +0000 (GMT) Received: from vs3.bgnett.no (vs3.bgnett.no [194.54.96.185]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0FF6D43D1F for ; Tue, 22 Mar 2005 12:21:04 +0000 (GMT) (envelope-from peter@bgnett.no) Received: from amidala.datadok.no.bgnett.no (amidala.datadok.no [194.54.103.98]) by vs3.bgnett.no (8.12.9p2/8.12.9) with ESMTP id j2MCKHBM027683; Tue, 22 Mar 2005 13:20:19 +0100 (CET) (envelope-from peter@bgnett.no) To: "Eugene M. Minkovskii" References: <20050320093159.GA3213@mccme.ru> <861xaamf9t.fsf@amidala.datadok.no> <20050321071227.GA29429@mccme.ru> <86eke9fn7o.fsf@amidala.datadok.no> <20050322120451.GA3137@mccme.ru> From: peter@bgnett.no (Peter N. M. Hansteen) Date: Tue, 22 Mar 2005 13:18:27 +0100 In-Reply-To: <20050322120451.GA3137@mccme.ru> (Eugene M. Minkovskii's message of "Tue, 22 Mar 2005 15:04:51 +0300") Message-ID: <86hdj36fho.fsf@amidala.datadok.no> User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-bgnett.no-virusscanner: Found to be clean X-Envelope-To: emin@mccme.ru, freebsd-questions@freebsd.org cc: freebsd-questions@freebsd.org Subject: Re: OpenBSD's pf and traffic X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2005 12:21:05 -0000 "Eugene M. Minkovskii" writes: > pass out on $ext_if proto tcp all modulate state flags S/SA > pass out on $ext_if proto { udp, icmp } all keep state > > So, where could I put label to mark inbound traffic? This traffic > goes into my machine because I use state table. I'd say something along the lines of allowed_out = "{ ssh, domain, http, https, etc... }" pass out on $ext_if proto tcp $allowed_out label allowed-out keep state you could differentiate among source addresses, for example by specifying client1 = "{ 192.68.n.1, 192.168.n.2 }" client1 = "{ 192.68.n.3, 192.168.n.4 }" client2_inports = { whatever they need } pass out on $ext_if from $client1 to any proto tcp $allowed_out \ label client1 keep state pass out on $ext_if from $client2 to any proto tcp $allowed_out \ label client2-out keep state pass from any to $client2 $client2_inports label client2-in keep state and so on. Hope this helps. -- Peter N. M. Hansteen, member of the first RFC 1149 implementation team http://www.blug.linux.no/rfc1149/ http://www.datadok.no/ http://www.nuug.no/ "First, we kill all the spammers" The Usenet Bard, "Twice-forwarded tales"