[Help] Cant assign Static IP to 2nd NIC

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.

That message indicates that you already have another interface (eno2) on the subnet: 192.168.1.0/24

It is (per TrueNAS doc) strongly discouraged to put multiple interfaces on the same subnet.

Could you create another subnet in your router ?
ie: 192.168.2.0/24 , and assign that to another port or vlan ?

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?

The issue isn’t multiple devices on the subnet.
But problems can arise if you have multiple netcards on the same device connected to the same subnet.

Passing a NIC “IO / PCIe Passthrough” would work (if TrueNAS suports it)
I’m a TN beginner too.

But if you have passed a NIC to a VM, then TN wouldn’t see it, since it’s owned by the VM.
And you shouldn’t be able to configure ip etc via TN GUI.

But it should now be seen & configured in the VM.
So my guess is that you haven’t passed it through to the VM correctly.

As i’m a TN beginner too, i haven’t even tried to install an APP or a VM.
So the above is based on 30+ years as a Network guy.

1 Like

Then you will probably want to pass the NIC in as a PCIe device, rather than as a virtual network device

Note, this will mean that any communication between the VM and NAS will have to round trip via the upstream Ethernet switch.

Thank you both.

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?

Yes