From owner-freebsd-ipfw@FreeBSD.ORG Tue Jul 10 12:12:48 2012 Return-Path: Delivered-To: freebsd-ipfw@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 2AFAB106566B for ; Tue, 10 Jul 2012 12:12:48 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from dhcp170-36-red.yandex.net (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx2.freebsd.org (Postfix) with ESMTP id 463CC14E120; Tue, 10 Jul 2012 12:12:47 +0000 (UTC) Message-ID: <4FFC1BE8.6010205@FreeBSD.org> Date: Tue, 10 Jul 2012 16:11:20 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120511 Thunderbird/12.0.1 MIME-Version: 1.0 To: Rolf Grossmann References: <4FFB66AB.2020306@progtech.net> In-Reply-To: <4FFB66AB.2020306@progtech.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-ipfw@freebsd.org Subject: Re: Equivalent of in_port and out_port with in-kernel nat? X-BeenThere: freebsd-ipfw@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: IPFW Technical Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 12:12:48 -0000 On 10.07.2012 03:18, Rolf Grossmann wrote: > Hi, > > I've started switching my machines to in-kernel nat and I've run into a > case where I need to tell the nat instance which packets to treat as > incoming and which as outgoing. With natd I've been able to use divert > with different ports and in_port and out_port options. The in-kernel nat > however doesn't seem to have a method of specifying nat direction and > instead always uses the information from the interface. Not exactly. If we're talking about ipfw nat, situation is the following: ipfw nat module determines direction the following way: if outgoing interface exists (e.g. ipfw is called after routing decision is done, "out" case) then inside->outside translation is called ( LibAliasOut founction) otherwise outside->inside is called ( LibAliasIn). This behavior can be reverted by specifying 'reverse' keyword in nat configuration. Alternatively, you can specify in/out explicitly by using ng_nat with ng_ipfw. > > My question is, am I missing something? Is there a patch I could try? > Has the issue even come up before? > > Thanks, Rolf. > > _______________________________________________ > freebsd-ipfw@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-ipfw > To unsubscribe, send any mail to "freebsd-ipfw-unsubscribe@freebsd.org" > -- WBR, Alexander