I’d like to add something to this topic (and explicitly made a user only to do so) since it was one of the first I found when trying to solve this problem myself. I did not, however, want to make a bridged NIC for this purpose, as I have one physical interface and was worried about making a misstep and losing the connection to my NAS.
What I did instead is the following workaround:
For the explanation, lets say my home network looks like this:
Network 192.168.2.0/24
Router 192.168.2.1
NAS 192.168.2.20
VM 192.168.2.21
The workaround:
- Add a route in the VM to 192.168.2.20/32 via 192.168.2.1
- Add a route in TrueNAS to 192.168.2.21/32 via 192.168.2.1
Now the two devices will explicitly talk to each other via the router and can communicate. Downside: The packets go to the router, get routed, and travel back, wasting bandwidth.
Personally, in my situation, this was an acceptable workaround for what my VM does.