[SOLVED] Get internet connexion FROM a VM

Hello everyone,
I have an unsual question regarding network between Truenas and a VM :

I have made a VM for OPNsense and gave it full access to a PCie network card (x710-T4) via pcie passtrough and got everything working. The goal is for that VM + network card to be the main router of my network.

I would like to not “waste” 2 10gbps ports + 2 pcie ports just to give internet access to the truenas server the VM is running on.
Is there a way to have truenas use the virtual NIC created for the VM to get internet access ?

Thanks in advance

Of course. You need a bridge interface for that.

I never realised I could make a bridge without a physical interface. Guess i’ll sleep less dumb tonight. Thanks.

I would:

  • PCIe pass through for OPNsense WAN
  • Bridge with another physical interface and OPNsense LAN as vtnet, possibly connected to a switch
  • Also use that bridge as the main interface of TrueNAS

So TrueNAS and all devices connected to the switch get their uplink through the OPNsense VM.

You can of course drop the physical interface from the bridge if it is intended for VMs running on TN only.

But then why wouldn’t you run OPNsense as the firewall for your entire network?

HTH,
Patrick