From owner-freebsd-net@FreeBSD.ORG Mon Dec 2 08:02:19 2013 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 02EC9FEC for ; Mon, 2 Dec 2013 08:02:19 +0000 (UTC) Received: from shell0.rawbw.com (shell0.rawbw.com [198.144.192.45]) by mx1.freebsd.org (Postfix) with ESMTP id E516D197B for ; Mon, 2 Dec 2013 08:02:18 +0000 (UTC) Received: from eagle.yuri.org (stunnel@localhost [127.0.0.1]) (authenticated bits=0) by shell0.rawbw.com (8.14.4/8.14.4) with ESMTP id rB282ClP064622 for ; Mon, 2 Dec 2013 00:02:12 -0800 (PST) (envelope-from yuri@rawbw.com) Message-ID: <529C3E84.1030203@rawbw.com> Date: Mon, 02 Dec 2013 00:02:12 -0800 From: Yuri User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: net@freebsd.org Subject: DIOCNATLOOK fails with ipfw Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Dec 2013 08:02:19 -0000 I have an app with transparent proxy that should intercept all TCP connections in the interface. This is done with ipfw(8) rule like this: ipfw add 200 fwd 192.168.10.1,15020 tcp from 192.168.10.0/24 to any 80 keep-state Transparent proxy is on 192.168.10.1:15020 Proxy accepts the connections, however, it is using /dev/pf to get the original destination and the lookup procedure fails: ioctl(DIOCNATLOOK) failed: No such file or directory It fails because nobody ever calls pf_state_insert. I see from the source that ioctl to add the pf_state is DIOCSTART, which is issued by pfctl(8), but I am not using pfctl(8) at all. My questions are: What is the relationship between ipfw(8) and pfctl(8)? Do they do the same? Why two of them? If I only use ipfw, is there a way for the acceptor to find what the original destination was without /dev/pf? Yuri