TrueNAS Core Default Gateway

Hello,

I set up two networks on my TrueNAS Core box. The first network is a 10.x network on a vlan and the second network is a dedicated storage network connecting to a aggregate switch and to my xcp-ng boxes on a 172.x network.

The issue im having is that I have the default gateway set for the 10.x network so the traffic from my xcp-ng boxes are coming in on the 172.x address but then because the default gateway is set on the 10.x network its returning on that network to the xcp-ng boxes. I put a static route in TrueNAS saying to push anything for the 172.x address to the 192.x network but TrueNas/FreeBSD is still sending the traffic over the 10.x network.

Whats the proper way to configure this? I’m assuming removing the default gateway and setting up a bunch of static routes would probably work but that becomes allot to manage with multiple networks connected to my router.

Current Config
image

In NIC ix0 and out NIC em0

On your switch you need to create a VLAN of 100 for example. Then create a VLAN interface on truenas with the same VLAN ID. Configure your switch as a trunk port that has VLAN 100 configured on it. Then setup XCP-ng VLAN interface of 100.

Make sure you have bound your iscsi interface to your vlan100. There shouldn’t be any static routes for this.

Thank you. I set this up as you described and everything works in terms of the storage and iSCSI.

I realized that it also worked the way I had it before for storage but what I was doing was using that storage network to migrate a bunch of VM’s from the old storage to the new storage which I know your not supposed to do on a storage network but it was a one time thing just to speed up that move process.