Is there any way to enable / create an virtual switch?

vampyren

Dabbler
Joined
Feb 27, 2021
Messages
24
Hi,

Tried to search but dont find much info on this. On my qnap i have a virtual switch which all my vm's go through as shown in the image.
Is there something similar on TrueNAS ? Its much more convenient to use this the physical port for each VM.

1631451362564.png


Cheers
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I think you're looking for a bridge... plenty of how-tos around for that.
 

vampyren

Dabbler
Joined
Feb 27, 2021
Messages
24
I think you're looking for a bridge... plenty of how-tos around for that.
Maybe, i'm not a huge linux guru and much of this is new to me. Without a UX like qnap its hard to know how to do things. I can do it if there are good guides i'm sure. Knowing its a bridge will help me search better so maybe i can find something i can follow.
Thanks. Will check more tomorrow. If you or any other have any link please do add. Cheers!
 

FreeNASftw

Contributor
Joined
Mar 1, 2015
Messages
124
Did you make any progress on this? My installation won't even let me create a bridge. I go to network, interfaces, add, type=bridge - from here it won't let me add a bridge if it doesn't have an IP address, which I think is weird, but anyway, add a valid random address and an interface, or three, or none and all I can get is "test changes" and a spinning wheel, once the wheel is done spinning the "br0" interface disappears from the list and is gone.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
I would suggest filing a bug report on that (see "Report a Bug" at the top of every page).
 

FreeNASftw

Contributor
Joined
Mar 1, 2015
Messages
124
that doc is right for core. Unix bridges are named bridge<x>, linux, br<x>. But they're practically identical.
Yes, it seems that all the helper (explanations) links in the UI are copy pasted from Core and thus go to BSD man pages.
 

FreeNASftw

Contributor
Joined
Mar 1, 2015
Messages
124
Is it correct that we shouldn't be able to add a bridge with no IP address?
Or, same question without the negations.
Should we be able to have a bridge with no IP address?
 

ian351c

Patron
Joined
Oct 20, 2011
Messages
219
Hi @FreeNASftw,

You can have a bridge without an IP address. I currently have two bridges and 4 physical interfaces on my TrueNAS SCALE machine. I have one of my bridges configured with 1 physical interface as a member and no IP address. This bridge (br0) is my "VM virtual switch" and is the interface that I assign all my VMs to. I also have another bridge (br1) without any physical interfaces and no IP address as a "host only" virtual switch. Note that the physical interface I assigned to br0 is NOT my main physical interface (the one that is running the GUI and NAS services such as SSH, SMB, NFS, etc.). I tried this once and was not able to talk to the TrueNAS GUI, so it rolled back. So my setup is close to what you show in your first post.
 

FreeNASftw

Contributor
Joined
Mar 1, 2015
Messages
124
Hi @FreeNASftw,

You can have a bridge without an IP address. I currently have two bridges and 4 physical interfaces on my TrueNAS SCALE machine. I have one of my bridges configured with 1 physical interface as a member and no IP address. This bridge (br0) is my "VM virtual switch" and is the interface that I assign all my VMs to. I also have another bridge (br1) without any physical interfaces and no IP address as a "host only" virtual switch. Note that the physical interface I assigned to br0 is NOT my main physical interface (the one that is running the GUI and NAS services such as SSH, SMB, NFS, etc.). I tried this once and was not able to talk to the TrueNAS GUI, so it rolled back. So my setup is close to what you show in your first post.


Hi ian351c,

Thanks for the feedback - that is exactly what I am trying to do - however my machine doesn't seem to want to do it, it specifically tells me that I need to add an IP address for example, which as I say, seems ridiculous. Even after trying all options, I still can't add the bridge at all, it just disappears after a lot of thinking.

I'll try to go through some logs tomorrow and see if tells me anything useful.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
You could always assign some unused RFC1918 address to it. This is the conventional way to tell something that's demanding an IP that it shouldn't be demanding to bugger off.
 

ian351c

Patron
Joined
Oct 20, 2011
Messages
219
I'm running the 28.01 Beta (not a nightly) and I installed it fresh (so no configuration from earlier versions of SCALE), so that might be a difference if you are running a nightly. Also, what @jgreco says is definitely true. Just assign it an address that isn't used and isn't routable and go from there (though that's a workaround more than a solution).
 

FreeNASftw

Contributor
Joined
Mar 1, 2015
Messages
124
Is there some meaningful write up of how to add a bridge - I have now fresh installed TrueNAS Scale 3 times, first on mirrored USB drives, now on mirrored SSD.
I literally login and first thing I do after making the boot pool a mirror is try to add a bridge.

Go to network, interfaces, add, type=bridge, name=br0, descr=xyz, members=somephysicalPort, ip address=someRandomAddress.

I have tried variations of this a dozen times across the 3 fresh installs and it just will not work, no errors in the front end at all

I am also running 28.01 Beta.

Once I click the final "apply" button, the bridge is visible in the interface list, I get a popup "test changes", I tick confirm and click test changes, then I get the spinning wheel of "please wait". The spinning wheel keeps going until I assume there is some backend timeout, and then my bridge is gone.

Right now, the wheel has finished spinning, my bridge was still in the list for 5 or so seconds, and then it just disappears.

The entire network stack seems to crap out, SSH times out with broken pipe, web interface times out.

Is there a better log to watch than /var/log/messages?
Where is the network config file that I can look at?

Most other things seem to work fine - I can change system settings, add storage, create VM's...
 

FreeNASftw

Contributor
Joined
Mar 1, 2015
Messages
124
A bit more testing and it seems I can't add any kind of interface at all, the behavior is the same as described above. I have raised a bug ticket.
 

Vertigo 7

Explorer
Joined
May 8, 2021
Messages
78
do you have direct console access to the server? you'll get a prompt on the console to confirm the network settings there as well.
 

ian351c

Patron
Joined
Oct 20, 2011
Messages
219
I would get the "disconnection from SSH/GUI and then fall back in 60 seconds" behavior if I tried to add my "main" interface (the one the runs the TrueNAS GUI) to a bridge. If I add a different physical interface (or no physical interface) to the bridge, it worked fine for me.
 

FreeNASftw

Contributor
Joined
Mar 1, 2015
Messages
124
I have IPMI access - interesting. If I press 1 for "Configure network interfaces" I get "Sorry, network configuration helpers work still in progress".
I haven't touched this host all night.
 

Vertigo 7

Explorer
Joined
May 8, 2021
Messages
78
weird. i gave scale a go a few days ago with the current beta release, and i didn't get a menu like core to drill down into configs with 1, 2, 3, etc. I had to type out a command sequence, something like

network interface add type="VLAN" vlan_parent_interface="en0" vlan_tag="5"

etc, etc.

tbh, i hated it, but it was all that was presented to me through my IPMI. but anyway when i made a change to the network config through the GUI, on the console i'd get prompted to type 'network confirm' or something similar and a count down before the change would revert.

I've since gone back to core but I did get several bridges created, each with only a vlan interface as a member, and only the bridge in the vlan i wanted the OS to have network access on was given an IP address.
 
Top