Use Truenas as Network Switch

mangoon

Dabbler
Joined
Dec 18, 2022
Messages
13
Hey all,

I'm fairly new to TrueNAS and currently trying to figuring our, how the networking part works...

My usecase is as follows: I want to replace my remote backup NAS, thats a QNAP atm with a microserver. For that I also have a raspi, configured for remote access and, as on location I only have access to one wired connection and no wireless, I was pretty successful before, configuring a virtual switch in QNAP and using one LAN Interface to connect to the network and the other one to attach the raspi. There it just got an IP from the DHCP and everything was fine.

Now on TrueNAS (Core) I try to replicate that and already learned, that there are no virtual switches and am struggling with the network config. I tried to just bridge the two physical Ports... Now I have a static IP on my connected Interface and set the bridge to DHCP. But The Raspi doesn't get an IP from the DHCP. So has anyone already done something like that? What am I doing wrong? Do I have to just use static IPs?

Thanks a lot in advance
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
You can build a virtual switch with TrueNAS CORE. It's called "bridge". Switch is just a fancy marketing name for a multiport bridge.

Configure all physical interfaces that will become part of the switch like this:
  • Disable hardware offloading
  • No IP address
  • No IPv6 autoconfiguration
  • No DHCP
  • Options field: "up"
Create a bridge interface:
  • Type: bridge
  • Name: bridge0
  • Member interfaces: all applicable
  • Static IP address configuration recommended
  • IPv6 autoconfiguration if desired
The IP address must be on the bridge interface, not one of the members. The members must have no IP address configuration but the "up" option.

HTH,
Patrick
 

mangoon

Dabbler
Joined
Dec 18, 2022
Messages
13
Alright thank you for now. Can one of the Interfaces be the One for the UI? And how to configure that? The issue I have atm ist, that as soon as I change it, as you wrote I loose my connection to the console and the changes get reverted...
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
You must put the IP address on the bridge interface and use that address to connect to the UI. Or reconnect after clicking in "Test Settings". You can also change the timeout from 60 seconds to something longer before klicking.
 
Last edited:

mangoon

Dabbler
Joined
Dec 18, 2022
Messages
13
Thank you so so so much!

Just for anyone maybe wanting to do that too:

I worked around the "Test Setting Timeout" by first setting a static IP on my active interface, then configuring the bridge with dhcp and the offline Interface (My box only has two interfaces...). Than after saving that, I connected to the GUI via the bridge IP and deleted the static IP again from the other interface...
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
If you want to continue to set the bridge IP address via DHCP, I recommend to use these two tunables to make the bridge MAC address identical to that of the first member interface:

Bildschirmfoto 2022-12-21 um 13.50.51.png
 
Top