Hi. Here’s the situation. My mobo has dual onboard NICs. One of them is obviously the main network connection for the TrueNAS system itself. The 2nd, I’m using as a dedicated NIC for a VM.
The NIC for TrueNAS is eno2 which I’ve configured in TrueNAS>Network>Interfaces to be a static IP of 192.168.1.3
When setting up the VM (using TrueNAS Scale’s built in virtualization) It asks for “NIC to attach”. I chose eno1, which is the other physical NIC on the mobo. Then I tried going to TrueNAS>Network>Interfaces to set a static IP for eno1 of 192.168.1.4 and I keep getting this message “[EINVAL] interface_update.aliases.0: The network 192.168.1.0/24 is already in use by another interface.”
I also tried going to TrueNAS>Network>Interfaces and for eno1 unticking DHCP and NOT adding an alias, just left it blank and hit save, then tried setting a static IP within the Guest OS, that breaks the connection to the network, VM can no longer access network. As long as the VM is set to DHCP within the guess OS, I can access network regardless if the DHCP box in TrueNAS>Network>Interfaces is ticked or not. But whatever I try, I cannot set a static IP address for the VM. Please tell me what I’m doing wrong and how to fix this.
I did try searching for the answer before posting and came across several threads talking about not having multiple interfaces on the same subnet. However, that is just confusing because isn’t that done all the time on a network? If I have several devices on a network (laptop, desktop, server, etc.) and the router assigns them IPs via DHCP, and each one of those devices has an interface, is that not multiple interfaces on the same subnet? For example router assigns as follows:
laptop (192.168.1.1/24)
desktop (192.168.1.2/24)
server (192.168.1.3/24)
So am I misunderstanding how Dual NICS work, are they not actually independent of one another?
I thought that if I was passing through one of the physical NICS to the VM, and it’s not being used at all by the host system, that essentially the network would just “see” it as another device on the network, just as if it was a separate physical machine. And it does work exactly like that if I leave it as dynamic IP assigned by the router, so why does it not work when set to a static IP that is not being used by any other device on the network? What am I missing?
As far as the communication between the VM and NAS having to round trip via the upstream switch, that makes sense, in fact that’s what I thought would be happening with the way I have it configured now, but clearly I was wrong.
As far as passing the NIC as a PCIe device, just to make sure I understand you correctly, would the correct way to do this be from within TrueNAS? Go to virtualization, select the VM in question, click on devices, add, PCIe passthrough device, then select the NIC I want to use?