Re: How to force network packets across network instead of loopback

From: Dag-Erling_Smørgrav <des_at_FreeBSD.org>
Date: Thu, 11 Sep 2025 11:40:08 UTC
Sad Clouds <cryintothebluesky@gmail.com> writes:
> Hello, I have two network interfaces ix0 and ix1 on the same FreeBSD
> host.  When transferring data between those interfaces, is there a way
> to force FreeBSD to send and receive packets across the physical
> network, instead of using loopback?

Assign one of them to a vnet jail:

    # jail -c name=ix0 path=/ persist vnet vnet.interface=ix0
    # jexec ix0 ifconfig ix0 inet 192.0.2.1/24 up
    # ifconfig ix1 inet 192.0.2.2/24 up
    # jexec ix0 ping -c 3 192.0.2.2
    # ping -c 3 192.0.2.1

Alternatively, assign them both to separate jails:

    # jail -c name=ix0 path=/ persist vnet vnet.interface=ix0
    # jexec ix0 ifconfig ix0 inet 192.0.2.1/24 up
    # jail -c name=ix1 path=/ persist vnet vnet.interface=ix1
    # jexec ix1 ifconfig ix1 inet 192.0.2.2/24 up
    # jexec ix0 ping -c 3 192.0.2.2
    # jexec ix1 ping -c 3 192.0.2.1

DES
-- 
Dag-Erling Smørgrav - des@FreeBSD.org