From nobody Wed Dec 10 14:44:38 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 4dRJQz00dRz6Kg96 for ; Wed, 10 Dec 2025 14:44:59 +0000 (UTC) (envelope-from tom.smyth@wirelessconnect.eu) Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) (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 4dRJQy3Y8dz3Fxw for ; Wed, 10 Dec 2025 14:44:57 +0000 (UTC) (envelope-from tom.smyth@wirelessconnect.eu) Authentication-Results: mx1.freebsd.org; none Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-42e2e08b27eso2988518f8f.1 for ; Wed, 10 Dec 2025 06:44:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wirelessconnect.eu; s=google; t=1765377890; x=1765982690; darn=freebsd.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=MJJ28Na/aRFm9WFVUdYdJDqul1/ZK6aO597pP772h5k=; b=r5s4SlS6QM/NxcydiP2//C30EqadezpWJiChB5JGUM9nkSX25cocGcnrdXKfJpxTFr wZeD3yNVTNcf1nfYfrvs/NfwFlsYm/b4soySSYd2Zb6PZs+is0BpMCcTa8mUmt3zj637 EnlVOHJCMUflQZW6WxJI/agAe7Avcw23ZXMaPqhe6np1SD9Whh2QrIX71+2LUdMxjZV+ 5wSmc1+rDiQiM9ApZPFqibg0NutiJXayWIfIx0hpEsW7tqF46P6zSpc22nfBvt06Ijzp GI87gcbH0ZCuj799qeg6oJW0/QYQxx6kpY6aQ8Kk+a3VCNE65mCe3Nhy7S3kS7dlUW+p 1GpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765377890; x=1765982690; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MJJ28Na/aRFm9WFVUdYdJDqul1/ZK6aO597pP772h5k=; b=XINYqRvfVDZ6kbM8WqGNeNaICZO/vcN65qncfX/oKhToeA4R6OA19DK3JCSuQw++rq k8tgKvohgM+L5Uz69qNpz8NwOE3IWWQelaZoAYFssGOyONQZ8qGqhDp/Zw29DmnSCmnB Iui64gkffKKRILu5L+oRbV+sb4QEC+uQEj9gQrLTol9uGHk1mCPURBLa+LdlEWfMYsqI 0T6gr7bTmAT8H2DNt+Zk70az+8x7vnTRsOOfpItZBC2p++shJwTL4a+vgbBT3jtB3reN mQlLUhUwBBGvrSxGOL34zPt5sbb3uTJvBBtLJHs8JUG7aNyYszoKFFU8BjwA7/Bo+8uB n/nw== X-Forwarded-Encrypted: i=1; AJvYcCVGeGBNy3gepetF3J7XpjzTQhDkIgDQZelUp+WZ2GnDcRe+W2vLhFon/r3fPbh2Ngtpzr0zuwXXmBkcWQ==@freebsd.org X-Gm-Message-State: AOJu0YyGYZvXNnpEBbfuCP94tQWRw2EKXwyVplElZPSqTYBl97SQI3nF Saa7/QEjdp8gOSSGhBeJ51cuxAZ6sN3WOUpFZQ1NlzAgaHhaiqx/mk1NmCZLMD4mWAhMr1DrM4l 1WTcvnz2yvQpDdZ/BEmgnWp8F7GzxaslnTrTQYTpgKw== X-Gm-Gg: AY/fxX6GCecQNI+WjJ6rKB8KCBwDucUIoL7dobnH5vuO/nS9pS2knb1BMhy7VYnOC0/ oUrqy7+BZH8HPdGJO84ZAWi/kut/tgE814u1lWEIRVFU9mVduekQL4sgbJLd5FvBfzO7sgP9vKm uA9xSJ/MA4CByFIu4x9wifCdta1ST7t4f5rBUoYyXulSipsOq9e4ha/tRLAQK1zmYdsQaWuuoBF DJFu2ft0pn5cH0SeJznj1hSXcNSA7cDkRd+dCgNk87Kh+ZET0NuESZxqLS2d0ZwwuPMPxl9Orgo qSB4WFOmqIVxk1mUwgKs1zK7MFmrUEICkGKH0/AQPVEqDDL0pjMK8ckS5WGC0bBMDHDzVT2TK92 t88Gr9kgfU0AR1uAXlQT4blypbPyO9NN+IRHYFd9jILoEYtfM20UzExumtaL7wb8izRXMMHUPSg bY7s6BtgAqvekX0Fn/tPvsen4tSVgts67beqL2cxaDxcPhuwgEjhB6Q4F/SZLH4dd383Y8mW+kw sMT5B36IZHUjKqp84Psy29T2ngWzjYsR4GzvJ5wvhHbGrhvNV/f X-Google-Smtp-Source: AGHT+IHOjB59bTBhTXN96YZy2Jp/BjITX9P7xPNJT0eq2nnoT76WTG35vVPyGrRsJBjP+GycUfM2S+//OVshsnde788= X-Received: by 2002:a05:6000:4304:b0:3fb:aca3:d5d9 with SMTP id ffacd0b85a97d-42fa39d9430mr2493516f8f.1.1765377890204; Wed, 10 Dec 2025 06:44:50 -0800 (PST) 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: <3C76FF27-49A7-4C45-8E8F-51C1BBF3C6E0@lysator.liu.se> In-Reply-To: <3C76FF27-49A7-4C45-8E8F-51C1BBF3C6E0@lysator.liu.se> From: Tom Smyth Date: Wed, 10 Dec 2025 14:44:38 +0000 X-Gm-Features: AQt7F2rGQ8klM9C4rRxiucXE3nB4aAE5u5lK5_jGiqkcx793WXjkUX2MtGWpGWs Message-ID: Subject: Re: Is it possible to force packets to go over a loopback cable? To: Peter Eriksson , freebsd-net@freebsd.org Content-Type: multipart/alternative; boundary="0000000000000a4de506459a12c9" X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: 4dRJQy3Y8dz3Fxw --0000000000000a4de506459a12c9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Peter im guessing Loopback cable as in a cross over cable between two interfaces.. as opposed to a loopback cable plugged into the one interface (ie tx - rx wired together) in principle you want to put the interface you are routing to into a different routing domain... so lets just say you have IP address A on interface A on the loopback cable, and IP address B on the interface B on the loopback cable, put interface B into a different VRF (networking language) / Routing domain Rtable (openbsd terminology) ... run the process you want to send packets inside the VRF listening on IP address B ... and set the default gateway routing out to Interface A ... but that is the approach I would use. which just uses routing and the physical cross over cable between two interfaces... and all that can be done without VRF leaking in the firewall support in PF Im not sure how to do that in FreeBSD... but im sure they support the same functionality ... Tom Smyth On Wed, 10 Dec 2025 at 14:25, Peter Eriksson wrote: > I=E2=80=99d like to find some way to force FreeBSD to send a stream of pa= cket over > a loopback cable connected between two ethernet ports on the same machine= , > but it seems FreeBSD also short-circuits it and handles that traffic > internally in the OS. Which normally is a good thing for speed, but bad > when you are trying to test suspect cables :-) > > I=E2=80=99ve found references that back in the pre-FreeBSD 10 days there = used to > exist a sysctl: > > net.link.ether.inet.useloopback > > that could be set to 0 to disable this internal shortcut and force the > packets out onto the cable=E2=80=A6 > > Any suggestions? :-) > > - Peter > --=20 Kindest regards, Tom Smyth. --0000000000000a4de506459a12c9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Peter=C2=A0
im guessing Loopback cable as in a cros= s over cable between two interfaces.. as opposed to a loopback cable plugge= d into the one interface (ie tx - rx=C2=A0 wired together)=C2=A0
=
in principle you want to put the interface you are routing t= o=C2=A0 into a different routing domain...=C2=A0

s= o lets just say you have IP address A on interface A=C2=A0 on the loopback = cable, and IP address B on the interface B on the loopback cable,=C2=A0

put interface B into a different VRF (networking lang= uage)=C2=A0 / Routing domain=C2=A0 Rtable=C2=A0 =C2=A0(openbsd terminology)= ...

run the process you want to send packets insi= de the VRF listening on IP address B ... and set the default gateway routin= g out to Interface A ...=C2=A0=C2=A0


but that is the approach I would use. which just uses routing and=C2=A0 t= he physical cross over cable=C2=A0 between two interfaces...=C2=A0

and all that can be done without VRF leaking in the firewa= ll support=C2=A0 =C2=A0 =C2=A0in PF=C2=A0

Im not s= ure how to do that in FreeBSD... but im sure they support the same function= ality ...=C2=A0


Tom Smyth=C2=A0



On Wed, 10 Dec 2025 a= t 14:25, Peter Eriksson <pen@lysat= or.liu.se> wrote:
I=E2=80=99d like to find some way to force FreeBSD to send a str= eam of packet over a loopback cable connected between two ethernet ports on= the same machine, but it seems FreeBSD also short-circuits it and handles = that traffic internally in the OS. Which normally is a good thing for speed= , but bad when you are trying to test suspect cables :-)

I=E2=80=99ve found references that back in the pre-FreeBSD 10 days there us= ed to exist a sysctl:

=C2=A0 net.link.ether.inet.useloopback

that could be set to 0 to disable this internal shortcut and force the pack= ets out onto the cable=E2=80=A6

Any suggestions? :-)

- Peter


--
Kindest regards,
Tom Smyth.
--0000000000000a4de506459a12c9--