Assign/Choose Wich nic is used for what purpose

Hellrazorx

Dabbler
Joined
Apr 30, 2021
Messages
29
Hi all,

First, I'm an outlaw and using two different adapters on the same subnet. But I'd have the same question if I used vlans or different subnets:

First: the screenshot
1658464781957.png


So there:
- Lagg7 intended use is for internal network access. This is ''forced'' through dns resolution to 192.168.1.12.. FIne fine- Works as expected
- igb0 intended use is for offsite replication jobs and cloud syncs. This is decided by god.. Fine fine works as expected... But why...

In the screenshot, there are actually Transfers going through the network (saturating GB net 117.35mb) and another pushing through openvpn.. (7.31mb)

So yeah. I'm not sad.. everything works fine and it ran like this for more than year...
But... I feel lucky tho, and luck is the most durable fuel out there.

Is there a part I'm missing? Did I go sleepwalking and figured out something and I don't remember how I did?

thanks for any clue
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
You cannot have two interfaces in the same subnet:

You can use one interface for jails and/or VMs and one for all other TrueNAS services. Because jails and VMs all have their own network stack and in TrueNAS these are just layer 2 connections. But all TrueNAS services, sharing, replication, web UI, ... use the same IP stack, the same routes, and you cannot force them in any way to use different interfaces.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
and you cannot force them in any way to use different interfaces
I bet people think that since you can "bind" to an IP in a few of those services, that means you have locked it to a NIC... which would be wrong.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
You can bind services to NICs for incoming packets, but outgoing ones will always follow the system's routing table.
 

Hellrazorx

Dabbler
Joined
Apr 30, 2021
Messages
29
You cannot have two interfaces in the same subnet:

You can use one interface for jails and/or VMs and one for all other TrueNAS services. Because jails and VMs all have their own network stack and in TrueNAS these are just layer 2 connections. But all TrueNAS services, sharing, replication, web UI, ... use the same IP stack, the same routes, and you cannot force them in any way to use different interfaces.
Hi,
I can't but I do, take a look at the screenshot.

But yeah I understand I cant control it
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Okay, you cannot have two interfaces on the same subnet and expect to control what traffic goes where or even expect consistent results from such a setup. Better? :wink:
 

HoneyBadger

actually does care
Administrator
Moderator
iXsystems
Joined
Feb 6, 2014
Messages
5,112
But... I feel lucky tho, and luck is (not?) the most durable fuel out there.

Computers don't run on luck, they run on Magical Blue Smoke. ;)

Your system's routing table has decided that for this boot, this interface-up, or this phase of the moon, your OpenVPN endpoint is best reached by the .46 IP - but the rest of the 192.168.1.0/24 is best reached by the .12 IP.

How long this will work is anyone's idea. Best to set up two separate IP spaces and remove the element of chance.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
Perhaps to go back to the OP's intent here...

Are we saying that the "coin toss" between equally costed routes is done once per "interface-up" or per boot, etc. ?

I think that would sort of answer the original "why?" question.

It's a coin toss and the decision is remembered for a while. (correct me if I'm misinterpreting that)

As a general assessment, "being an outlaw" or wanting to "stick it to the 'man'" in this case only sticks it to a specific "man", in this case the OP, in the form of routing uncertainty/unpredictability between boot/interface-ups.
 
Top