From owner-freebsd-bugs@FreeBSD.ORG Thu Aug 12 11:20:02 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D008106567A for ; Thu, 12 Aug 2010 11:20:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 205EB8FC0C for ; Thu, 12 Aug 2010 11:20:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o7CBK2mD058490 for ; Thu, 12 Aug 2010 11:20:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o7CBK1BJ058489; Thu, 12 Aug 2010 11:20:02 GMT (envelope-from gnats) Resent-Date: Thu, 12 Aug 2010 11:20:02 GMT Resent-Message-Id: <201008121120.o7CBK1BJ058489@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Alexander Apanasenko Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79C0A106567A for ; Thu, 12 Aug 2010 11:15:36 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 68F2C8FC08 for ; Thu, 12 Aug 2010 11:15:36 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o7CBFZ1L051077 for ; Thu, 12 Aug 2010 11:15:35 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o7CBFZiY051076; Thu, 12 Aug 2010 11:15:35 GMT (envelope-from nobody) Message-Id: <201008121115.o7CBFZiY051076@www.freebsd.org> Date: Thu, 12 Aug 2010 11:15:35 GMT From: Alexander Apanasenko To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/149572: ipfw kernel nat not working properly X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Aug 2010 11:20:02 -0000 >Number: 149572 >Category: kern >Synopsis: ipfw kernel nat not working properly >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Aug 12 11:20:01 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Alexander Apanasenko >Release: 8.1-RELEASE >Organization: >Environment: FreeBSD gate100.bis 8.1-RELEASE FreeBSD 8.1-RELEASE #1: Tue Aug 10 11:25:07 MSD 2010 apanas@gate100.bis:/usr/obj/usr/src/sys/GATE i386 >Description: After upgrade from 8.0-RELEASE to 8.1-RELEASE in IPFW kernel nat rules not working. Config nat in ipfw is: ipfw nat 1 config if fxp2 log deny_in same_ports reset rules: ... 20700 nat 1 ip from any to any via fxp2 29900 deny ip from any to any sysctl net.inet.ip.fw.one_pass net.inet.ip.fw.one_pass: 1 fxp2 is external interface. In 8.0 release these rules work fine, 20700 12221 1314739 nat 1 ip from any to any via fxp2 29900 0 0 deny ip from any to any but in 8.1 all packets matched with rule 20700 not leave firewall and continue move to rule 29900 20700 0 5847 nat 1 ip from any to any via fxp2 29900 0 6023 deny ip from any to any >How-To-Repeat: On 8.1-RELEASE system with kernel ipfw options options IPFIREWALL options IPFIREWALL_VERBOSE options IPFIREWALL_VERBOSE_LIMIT=100 options IPFIREWALL_FORWARD options IPFIREWALL_NAT options IPDIVERT options DUMMYNET options LIBALIAS and sysctl net.inet.ip.fw.one_pass=1 do: ipfw add allow ip from any to any via int_iface ipfw add nat 1 ip from any to any via ext_iface ipfw nat 1 config if ext_iface same_ports ipfw add deny ip from any to any and you can see that all packets after aliasing on nat 1 rule go to deny rule. >Fix: >Release-Note: >Audit-Trail: >Unformatted: