From owner-freebsd-net@freebsd.org Fri Sep 15 09:33:59 2017 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60944E09C9B; Fri, 15 Sep 2017 09:33:59 +0000 (UTC) (envelope-from srs0=pom8=aq=sigsegv.be=kristof@codepro.be) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 10B6083F38; Fri, 15 Sep 2017 09:33:58 +0000 (UTC) (envelope-from srs0=pom8=aq=sigsegv.be=kristof@codepro.be) Received: from [169.254.49.62] (vega.codepro.be [IPv6:2a01:4f8:162:1127::3]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id CCFA6466A3; Fri, 15 Sep 2017 11:33:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sigsegv.be; s=mail; t=1505468035; bh=Rb0+eTInI/bRd+H2L5jt+T1ZQs9Su7AGyjDx3QBGhp4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=e+xkLc47HjV3MKwfQhoA4I0Rf7eAyFZVV/tg/4iKQQ67ZKrvKwRqHs1ErwEgAFqaS fJWu5AqW4jYmHerGCNuw36X2w9uzYDVnW6k0bVv6MfN/rAxmSVCTKVIhB7WpTgZy6d Nm+xQaxpquUXXRO/ES9zgBdr06CKhkdSbC+UsCk8= From: "Kristof Provost" To: "Dave Cottlehuber" Cc: freebsd-net@freebsd.org, freebsd-pf@freebsd.org Subject: Re: NATted outbound traffic sometimes uses backup CARP IP on LACP/LAGG interface Date: Fri, 15 Sep 2017 11:33:58 +0200 Message-ID: <91414E93-FAFF-4EE6-A91D-F10FDA959783@sigsegv.be> In-Reply-To: <1505467875.1199722.1107024744.004A81D1@webmail.messagingengine.com> References: <1505398868.955393.1106053824.42CA3E40@webmail.messagingengine.com> <4250D983-3CE2-4156-85FB-E580F6C592D2@sigsegv.be> <1505467875.1199722.1107024744.004A81D1@webmail.messagingengine.com> MIME-Version: 1.0 X-Mailer: MailMate (2.0BETAr6090) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2017 09:33:59 -0000 On 15 Sep 2017, at 11:31, Dave Cottlehuber wrote: > Can you explain what $if:0 resolves to, for example how does it relate > to to the primary ipv4/6 addresses bound to that interface? > > I couldn't find a reference in the usual ifconfig manpages about this > (ifname:#) format, the BNF grammar for pf.conf doesn't cover it > either, > and `pfctl -vnf ...` simply shows (lagg0:0). > It tells pf to not use any of the alias addresses. It’s explained in the pf.conf man page: Interface names and interface group names can have modifiers appended: :network Translates to the network(s) attached to the interface. :broadcast Translates to the interface's broadcast address(es). :peer Translates to the point-to-point interface's peer address(es). :0 Do not include interface aliases. Host names may also have the :0 option appended to restrict the name resolution to the first of each v4 and v6 address found. Regards, Kristof From owner-freebsd-net@freebsd.org Fri Sep 15 09:38:08 2017 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5E04E0A1B2; Fri, 15 Sep 2017 09:38:08 +0000 (UTC) (envelope-from dch@skunkwerks.at) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A88F91E1; Fri, 15 Sep 2017 09:38:08 +0000 (UTC) (envelope-from dch@skunkwerks.at) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id E5BDF20BF0; Fri, 15 Sep 2017 05:31:15 -0400 (EDT) Received: from web6 ([10.202.2.216]) by compute7.internal (MEProxy); Fri, 15 Sep 2017 05:31:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skunkwerks.at; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=mesmtp; bh=yiU5RfgLSLPW8M tdRPyV4gh48fM2XzLKF7KjGExWbiQ=; b=YyRh0X0XcYsO4npP7dzyjIt4L4kdg/ 9XSRAaB3k9qTcK8hVkSZ6qUPWj1+zRS90kVunbRLUWblLjCEYJau8hahfQ1c5D+L 4Xv89GnAjOI6It1HRt8sbTNA02MZRPNhZ/7PtJ6c3qPF4aP6L9/8TDKVOuS7HYN7 QLw63VtySHeFc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=yiU5Rf gLSLPW8MtdRPyV4gh48fM2XzLKF7KjGExWbiQ=; b=fx1PqEyzlUeWDXvQ5NsooL spS3uydy7WAo6KnDmXZxnSiiGQdqzdGGj2UT4MjGd+DqtrRiT8S3EOZadP0tUBvx fkrKEbWwN855dTXdAhqJuBXiiTsgRNHgaxwoGQqB8IUPmFexV4OsyqxlIEUfcG9i GFcaBi6gYPg7Yf23Xiv10PA/1eFILVZjKAtFRY8gsynwtS5W8/qRrJzOMRHsMMdn DZIXTek3z4vp09AL+e6tIzlw8DzrjFnErqGOW5cixNYrpZkm2VuX4UTKJtmnpHuu aU/msFyHX8zT12RKSxzvGsWFzIRUPbA2dkzLtJhONXOvlf75st9h478cWxE5nTow == X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id BC03A48004; Fri, 15 Sep 2017 05:31:15 -0400 (EDT) Message-Id: <1505467875.1199722.1107024744.004A81D1@webmail.messagingengine.com> From: Dave Cottlehuber To: Kristof Provost Cc: freebsd-net@freebsd.org, freebsd-pf@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-64b08692 Subject: Re: NATted outbound traffic sometimes uses backup CARP IP on LACP/LAGG interface In-Reply-To: <4250D983-3CE2-4156-85FB-E580F6C592D2@sigsegv.be> References: <1505398868.955393.1106053824.42CA3E40@webmail.messagingengine.com> <4250D983-3CE2-4156-85FB-E580F6C592D2@sigsegv.be> Date: Fri, 15 Sep 2017 11:31:15 +0200 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2017 09:38:08 -0000 On Thu, 14 Sep 2017, at 23:32, Kristof Provost wrote: > On 14 Sep 2017, at 16:21, Dave Cottlehuber wrote: > > Outgoing traffic (from a jail) via PF NAT over a LAGG/LACP sometimes=20 > > has the *backup* CARP IP address assigned to it. > > > I think this is your problem. You=E2=80=99re telling pf to nat to the IP= =20 > address of lagg0, but lagg0 has multiple addresses assigned. >=20 > =E2=80=98(lagg0:0)=E2=80=99 should work, or just use the IP address. Thanks Kristof! ($if:0) works perfectly, but I'll need to reboot to test this with the original carp setup though. Can you explain what $if:0 resolves to, for example how does it relate to to the primary ipv4/6 addresses bound to that interface? I couldn't find a reference in the usual ifconfig manpages about this (ifname:#) format, the BNF grammar for pf.conf doesn't cover it either, and `pfctl -vnf ...` simply shows (lagg0:0). A+ Dave