Multiple NIC routing, packets from the wrong NIC.

youpko

Cadet
Joined
Jul 24, 2021
Messages
2
First of all I am new to TrueNAS in general and my knowledge of Linux is limited at best.
I decided to try out TrueNAS scale but I am running into a small issue with the 2 Network interfaces in my test box.

I have the two following NIC:
  1. 1G Copper (On the motherboard) (Default route)
    • IP: 192.168.1.2/24
    • Gateway: 192.168.1.1
  2. 10G Fiber (Mellanox ConnectX-3 PCIe)
    • IP 192.168.2.2/24
    • Gateway: 192.168.2.1
The numbers above are just example numbers to keep it simple but reflect my situation.

Both cards are working, I see both entries in the network.
But replies are send from the wrong NIC when sending request to the non-default NIC.
From the PC (the pc is an other subnet that the server networks):
  • ping 192.168.1.2 and get reply back correctly,
  • ping 192.168.2.2 the reply comes form the 192.168.1.2 interface as that is the default interface.
After some searching on google I discovered to get this working you need to set up "source-based/policy-based" routing and I tried that with the command line and that worked. But I wonder is there a way to specify these things from the GUI. Messing with the command line I try to avoid because it is so easy to make mistakes and forget what I changed.

My goal is to to use the 192.168.1.2/24 as a dedicated management interface and separate it from the normal data tragic that should go via the 192.168.2.2/24 interface.

As I am completly new to TrueNAS it might be the case that I just missed the option somewhere.
 

bodly

Dabbler
Joined
Jan 1, 2021
Messages
16
Really need to see the routing table to make anything other than guesses. But it seems likely that the only way that your truenas box knows to route traffic is through the 192.168.1.0 subnet.

So an ICMP packet comes to 192.168.2.2, but that subnet doesn't have a route to send the packet back so it goes through the default gateway, the 192.168.1.0 subnet.
 
Top