From owner-freebsd-questions@FreeBSD.ORG Mon Jul 9 17:47:35 2007 Return-Path: X-Original-To: freebsd-questions@FreeBSD.org Delivered-To: freebsd-questions@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 937AA16A46E for ; Mon, 9 Jul 2007 17:47:35 +0000 (UTC) (envelope-from dan@slightlystrange.org) Received: from catflap.slightlystrange.org (cpc5-cmbg1-0-0-cust497.cmbg.cable.ntl.com [86.6.1.242]) by mx1.freebsd.org (Postfix) with ESMTP id 5603213C44C for ; Mon, 9 Jul 2007 17:47:35 +0000 (UTC) (envelope-from dan@slightlystrange.org) Received: by catflap.slightlystrange.org (Postfix, from userid 106) id 83754646E; Mon, 9 Jul 2007 18:47:32 +0100 (BST) Received: from stoopid.slightlystrange.org (stoopid.slightlystrange.org [10.1.3.142]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by catflap.slightlystrange.org (Postfix) with ESMTP id 056E66195; Mon, 9 Jul 2007 18:47:31 +0100 (BST) Message-ID: <469274A1.3080208@slightlystrange.org> Date: Mon, 09 Jul 2007 18:47:13 +0100 From: Daniel Bye User-Agent: Thunderbird 2.0.0.4 (Macintosh/20070604) MIME-Version: 1.0 To: chamnan chaladpat References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-questions@FreeBSD.org Subject: Re: I need to create PF (NAT) log file. 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, 09 Jul 2007 17:47:35 -0000 chamnan chaladpat wrote: > About Network Address Translation. > > I need to create PF log file that has external and local IP address > mapping. > > I need log file that has result like pfctl -ss command. > > How to create it? >From a bit of googling in the archives, I think the easiest way to do this is using packet tags: nat on $ext_if from !($ext_if) to any tag NAT_TRAFFIC -> ($ext_if) pass log on $ext_if tagged NAT_TRAFFIC keep state Note I have only done very cursory testing, but it seems to work. You can follow the logs in the normal way, using tcpdump(1). HTH Dan