From owner-freebsd-pf@FreeBSD.ORG Tue Jul 29 22:35:16 2014 Return-Path: Delivered-To: freebsd-pf@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8AAE8B9A for ; Tue, 29 Jul 2014 22:35:16 +0000 (UTC) Received: from mail-wi0-x233.google.com (mail-wi0-x233.google.com [IPv6:2a00:1450:400c:c05::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 251482FB5 for ; Tue, 29 Jul 2014 22:35:16 +0000 (UTC) Received: by mail-wi0-f179.google.com with SMTP id f8so1337023wiw.12 for ; Tue, 29 Jul 2014 15:35:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:content-transfer-encoding:subject:message-id:date :to:mime-version; bh=rYyd5hwuuFzl/xHhScpsiQBD1nOOEWKxZdiNiTGDn3Y=; b=fuR8rq5Sx45cS3lTMOPL1rXAxOoAzNmIk7zDLNH4i8tUQUJ3MLu2xTCGnmuwNE8FtZ yyl9rur0YxLWEr1V+KOUTaFebvgu+FXAdpVvqhA2nyof2rQPF6x7D4g1TWsX4iF501TI oiEEnEyOmrwlPdZJGnjemifUnKa9CzUzVaKfziPOR2Elq6B/8PGpIBk2CAIxOOpIgw4P cqp/VqLzY1+Ajsv7XWHnsXIoEpM9M2Nfvlu7H5zpn31xI75XV3g4OtKvHx6TNGh8WmXI gZbVHlaqTsJhhiYQ6aiLpMgPswNFQ+eNHPiL6yq32+HFkW+GhFr/3plc/Krf6bV7tj57 HFdw== X-Received: by 10.180.20.40 with SMTP id k8mr332436wie.54.1406673314220; Tue, 29 Jul 2014 15:35:14 -0700 (PDT) Received: from ?IPv6:2001:470:78f5:3:901d:db7:af09:1b6b? ([2001:470:78f5:3:901d:db7:af09:1b6b]) by mx.google.com with ESMTPSA id ey16sm48109422wid.14.2014.07.29.15.35.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 29 Jul 2014 15:35:13 -0700 (PDT) From: Sydney Meyer Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: NAT IPSec Traffic with pf Message-Id: <299C59F2-199F-4B27-9BB6-8ECC9FD77FDC@gmail.com> Date: Wed, 30 Jul 2014 00:35:12 +0200 To: freebsd-pf@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) X-Mailer: Apple Mail (2.1878.6) X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jul 2014 22:35:16 -0000 Hello everybody, i am trying to get pf to 'nat' outgoing packets originating from a = IPSec-Subnet, as pf simply seems not to translate the address. When = routing the Subnet everything work as intended. After reading the interwebs, i noticed quite some threads reffering that = this particular one would be a known problem with FreeBSD's pf and/or = it's IPSec-Stack. Anyone knows about this? Cheers, S.= From owner-freebsd-pf@FreeBSD.ORG Thu Jul 31 00:06:59 2014 Return-Path: Delivered-To: freebsd-pf@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CFA9515F for ; Thu, 31 Jul 2014 00:06:59 +0000 (UTC) Received: from mail-wg0-x22f.google.com (mail-wg0-x22f.google.com [IPv6:2a00:1450:400c:c00::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BBA527D3 for ; Thu, 31 Jul 2014 00:06:59 +0000 (UTC) Received: by mail-wg0-f47.google.com with SMTP id b13so1948280wgh.30 for ; Wed, 30 Jul 2014 17:06:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:content-transfer-encoding:subject:message-id:date :to:mime-version; bh=UVOqEFHiyuxDNa2Cqw8EgHidwDrc2nZ9RRj+nbXjxlA=; b=Jg52VtmoxHN3RuUxcg2K0eSJOKvVlBeengITC+DRX2iWmOxq3aDzhan4kiMjBji8HL I/GaMil6jwAaZAk5wWfeLkW82iuNV9p8up9yOxc0lEpnzrpz2rIckRWY/elQi6WRC3Da g3Gi2XZL81ZQyg+WBkz3i41pKb7NbiZIn8bwYK7LYdfEdlcsp1V8b8zBDR6lpbOguy9t 7rQC3lDOwJG96BnaGwJ3PzgiEGj1k5oKHvNIk4iwb0XAm/FEAx1SgN8u5wLGqq/AEUM7 EvlzErQmjNhXlq8Zi1ddiepvXKhSXjktFF/DcoBbNcr9lXdbZhmsU1E6ff+3BoOWoYOf hS0Q== X-Received: by 10.194.202.165 with SMTP id kj5mr11438915wjc.50.1406765217742; Wed, 30 Jul 2014 17:06:57 -0700 (PDT) Received: from ?IPv6:2001:470:78f5:3:a192:284f:6da8:537? ([2001:470:78f5:3:a192:284f:6da8:537]) by mx.google.com with ESMTPSA id gq4sm14741787wib.8.2014.07.30.17.06.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Jul 2014 17:06:57 -0700 (PDT) From: Sydney Meyer Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: NAT IPSec Traffic with pf Message-Id: <9B8D62A1-8377-4D27-8E1B-816E16C96E5F@gmail.com> Date: Thu, 31 Jul 2014 02:06:55 +0200 To: freebsd-pf@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) X-Mailer: Apple Mail (2.1878.6) X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jul 2014 00:06:59 -0000 Got a reply in the forums from "junovitch": "There is a bug in 10.0-RELEASE with how how the kernel is tagging the = mbuf allocated with IPSEC packets as it gets tagged to skip firewalling. = Hence PF can't NAT what it can't see. Short answer is you need to = upgrade to 10.0-STABLE or use an older version of FreeBSD. Long answers: http://www.freebsd.org/cgi/query-pr.cgi?pr=3D185876 - The PR with the = technical details. https://forums.freebsd.org/viewtopic.php?f=3D7&t=3D45691 - Same issue = and the troubleshooting that helped find it." Upgrading to 10 STABLE fixed the issue. Cheers, S.= From owner-freebsd-pf@FreeBSD.ORG Fri Aug 1 13:52:13 2014 Return-Path: Delivered-To: freebsd-pf@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7FAD37EF for ; Fri, 1 Aug 2014 13:52:13 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 681EE228B for ; Fri, 1 Aug 2014 13:52:13 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.8/8.14.8) with ESMTP id s71DqDfB022753 for ; Fri, 1 Aug 2014 13:52:13 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-pf@FreeBSD.org Subject: [Bug 127920] [pf] ipv6 and synproxy don't play well together Date: Fri, 01 Aug 2014 13:52:13 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 7.1-PRERELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: vegeta@tuxpowered.net X-Bugzilla-Status: In Discussion X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: freebsd-pf@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Aug 2014 13:52:13 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=127920 vegeta@tuxpowered.net changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |vegeta@tuxpowered.net --- Comment #5 from vegeta@tuxpowered.net --- The issue is also present in FreeBSD 10. What happens is that when synproxy code sents a SYN+ACK reply to client's SYN packet, it gets dropped here: sys/netpfil/pf/pf.c: 4153 if ((*state)->src.state == PF_TCPS_PROXY_SRC) { 4154 if (direction != (*state)->direction) { 4155 REASON_SET(reason, PFRES_SYNPROXY); 4156 return (PF_SYNPROXY_DROP); 4157 } I'm a bit surprised why it does not happen for IPv4 though, unless direction is wrong or the IPv4 packet does not match existing state. -- You are receiving this mail because: You are the assignee for the bug. From owner-freebsd-pf@FreeBSD.ORG Fri Aug 1 19:57:23 2014 Return-Path: Delivered-To: freebsd-pf@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE967E2B for ; Fri, 1 Aug 2014 19:57:23 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C66E32F53 for ; Fri, 1 Aug 2014 19:57:23 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.8/8.14.8) with ESMTP id s71JvNvA032586 for ; Fri, 1 Aug 2014 19:57:23 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-pf@FreeBSD.org Subject: [Bug 127920] [pf] ipv6 and synproxy don't play well together Date: Fri, 01 Aug 2014 19:57:23 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 7.1-PRERELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: vegeta@tuxpowered.net X-Bugzilla-Status: In Discussion X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: freebsd-pf@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Aug 2014 19:57:23 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=127920 --- Comment #6 from vegeta@tuxpowered.net --- pf_test6() is missing a check for M_SKIP_FIREWALL flags on mbuf, this flag is present on packets sent via pf_send_tcp(), like SYN+ACK reply to client. Following patch fixes the issue (line numbers will not match, I have a lot of other patches on pf): @@ -6068,6 +6211,9 @@ pf_test6(int dir, struct ifnet *ifp, struct mbuf **m0, struct inpcb *inp) if (kif->pfik_flags & PFI_IFLAG_SKIP) return (PF_PASS); + if (m->m_flags & M_SKIP_FIREWALL) + return (PF_PASS); + PF_RULES_RLOCK(); /* We do IP header normalization and packet reassembly here */ -- You are receiving this mail because: You are the assignee for the bug. From owner-freebsd-pf@FreeBSD.ORG Fri Aug 1 20:19:44 2014 Return-Path: Delivered-To: freebsd-pf@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 C29136BF for ; Fri, 1 Aug 2014 20:19:44 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA12B2190 for ; Fri, 1 Aug 2014 20:19:44 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.8/8.14.8) with ESMTP id s71KJi92083541 for ; Fri, 1 Aug 2014 20:19:44 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-pf@FreeBSD.org Subject: [Bug 176268] [pf] [patch] synproxy not working with route-to Date: Fri, 01 Aug 2014 20:19:44 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 9.1-PRERELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: vegeta@tuxpowered.net X-Bugzilla-Status: In Discussion X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: freebsd-pf@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Aug 2014 20:19:44 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=176268 vegeta@tuxpowered.net changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |vegeta@tuxpowered.net --- Comment #2 from vegeta@tuxpowered.net --- Created attachment 145230 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=145230&action=edit Fix synproxy operation for route-to targets for IPv4 and IPv6 The patch introduces the following changes: - New functions pf_rebuild_route and pf_rebuild_route6 create a minimal route struct which can be passed to ip_output or ip6_output if state already contains loadbalancing information. - Allocate pfse with M_ZERO to have zeroed pfse's route structs. - Check m for M_SKIP_FIREWALL in pf_test6(), this fixes bug 127920. - Introduce new route flag RT_PFROUTE, check for this flag before touching routes' counters as routes in pfse are not really allocated as routes should be. -- You are receiving this mail because: You are the assignee for the bug.