From nobody Mon Jun 30 01:48:58 2025 X-Original-To: freebsd-net@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bVpx76Zxtz5ylFY for ; Mon, 30 Jun 2025 01:49:15 +0000 (UTC) (envelope-from pprocacci@gmail.com) Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bVpx71Q40z3rgs for ; Mon, 30 Jun 2025 01:49:15 +0000 (UTC) (envelope-from pprocacci@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-ae35f36da9dso335257866b.0 for ; Sun, 29 Jun 2025 18:49:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751248149; x=1751852949; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Y7HHTzYgTUSYJzLIN9Awt60cop9uZ6ozBbaUfJUQ/eA=; b=jR3KVgqjiOatPla1Wi4O7AzmER/byWF1+CdqZ+5be+gyvmwuEp2fhdScrXFFDGHcjF FZb6LdCUfF/0DMSvwQn1ek7o6hcdqbGDxPlnO+f+8/Nhn6y0xDk3nIVz/z/IKMab40lw t3DtkAZZ7Kwzn1NWX2pKaZkqeO8xHHDrDmzoT/I5AJHZdXkUsCmyGR4liJ+Na7uda7Ai 3a6ttcIuKgPuMuyV923XyReknSfQuZ/9whDvCV/rQzvWb8StlIYEP5HF+V8yrWvWZBUu zNdf7fuhupijdqB1fHkO4Sg1XoJZHN921wmPRNBnklQzYQndP9fqoYyprFNemn9az0yG 8ZWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751248149; x=1751852949; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Y7HHTzYgTUSYJzLIN9Awt60cop9uZ6ozBbaUfJUQ/eA=; b=qVBw4pZt53Sdhzdjzbszh8I0ODZt3WurU7L3zPZZ70tZTsORgKa47OmS/ADi1iVhap 6zyepCGkuK+LTK7SiQgQ6wL3nBPEOtQIZWGkdkZw6NaIj1Qg9ydkvs7noaIdoJmz4VDP 4lW91C0x9aGVq6Zt5ieRDksX3o3RJYPXLYigKjPgsHBZv/nwcP49bozluNa9fNGNl6PH AsJxhBGXX+/mq9fJxPp3lcS6muIBEuQ1a4OP55B5piOnmmxrNWNueEEdEJFRO9LwLqqZ +36mKuWzc1TCbx1kSbq+XnVvczFlwFrDmSlFwObAaZBAKUSWQHIhs8Ux4euISZa6WIEN HvbQ== X-Gm-Message-State: AOJu0YwuROV6hdbTInq+0pH77doJHEvMIEtvaN3ZfxRTwcvMUW1/TTXT kRfytOgA6cvbW2zkOL8pt2Uq7no+TkhoYltOxiyLkJAyKiN+n+pSxmhPV78OG8NSGx397xwoP0v iQvCp4NZBMePuAMaH6O5ZGLQE6s9LBr9P X-Gm-Gg: ASbGncsjDuiGj1JeeB74X6h2zt8mtRE9t3lCNkempLC2rnqrxB76B6fdTE6pkC7BzIH iOxq8TS1DshiigqWPM5pkueuOLk//QQKi7bNu2dUTxtJd3x/a+oG33XrINKGjHi1DtLKIQNdCME IVa4IOOHBbAhJlPzxukAGSsqIHk7VS7PAf5AlgNsL2 X-Google-Smtp-Source: AGHT+IGX3BsWnSJo9w/FwGLa4vsob+F8wGnr748DK7iXLlo1OkgupKj5bREdMOzziZUBFLcYTsLlsFJvpkmV/xxpMnc= X-Received: by 2002:a17:907:edc2:b0:ae3:67c7:54a6 with SMTP id a640c23a62f3a-ae367c7565bmr647231466b.34.1751248148455; Sun, 29 Jun 2025 18:49:08 -0700 (PDT) List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@FreeBSD.org MIME-Version: 1.0 References: In-Reply-To: From: Paul Procacci Date: Sun, 29 Jun 2025 21:48:58 -0400 X-Gm-Features: Ac12FXzjzSE5i1KkPssXsA913zKenmU5vtrwA-zuD8aSDv6mWj5l5XU-ih8v-m4 Message-ID: Subject: Re: rp_filter equivalent? To: Mason Loring Bliss Cc: freebsd-net@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4bVpx71Q40z3rgs X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] On Sun, Jun 29, 2025 at 9:29=E2=80=AFPM Mason Loring Bliss wrote: > > Hi all. > > I'm wondering what the equivalent to the Linux rp_filter is on FreeBSD. I= 'm > asking because I've got a set-up on a hosting provider where I have a > floating IP address that's not related to the main IP address of my syste= m. > Which is to say, my system is a.b.c.10 and routes through a.b.c.1, and I'= ve > got a floating IP that's x.y.z.50. Traffic from that x.y.z.50 address is > supposed to route through a.b.c.1. > > I've got a vnet jail that's set up to use that x.y.z.50 address, and I've > assigned x.y.z.50 to epair0b in the jail, but I ran into a problem. I > couldn't tell that jail to use a.b.c.1 as its default gateway and that th= at > was out through epair0a without assigning an a.b.c address to epair0a, ev= en > though I don't actually have a spare assigned to me. > > I believe I can just tell Linux to ram packets out an arbitrary interface > if I turn off rp_filtering via a syscall, but I'm not sure how to cleanly > do this with FreeBSD, hence my resorting to pilfering an IP address. I'll > never receive traffic intended for this pilfered address and there's no > risk of it causing confusion, but it doesn't feel like a clean answer. > > So, there's my question: is there some way I can have my vnet jail send > packets out an interface that the system believes is unrelated to the IP > address assigned to that interface? > > Thanks! > > -- > (defun main () (format t "Mason Loring Bliss - mason@blisses.org - ") > (format t "By the mysgydynge of the sterysman, he was set vpon the pylys= ") > (format t " of the brydge, and the barge whelmyd. - Chronicle of Fabyan~= %")) PF is the closest thing you'll get to rp_filter. The "fix" your problem ...... You need to create a bridge. Add your main interface to the bridge. You can assign your .10 to the bridge. Then, you can create your epair. Assign the a side the bridge and the b side to your jail. Add your .50 the the 'b' side, and add the default route of .1. This allows L2+ traffic to work correctly for both the host and jail. ~Paul --=20 __________________ :(){ :|:& };: