Is it possible to force packets to go over a loopback cable?

From: Peter Eriksson <pen_at_lysator.liu.se>
Date: Wed, 10 Dec 2025 14:25:21 UTC
I’d like to find some way to force FreeBSD to send a stream 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’ve 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…

Any suggestions? :-)

- Peter