SOLVED Bridge connections not working?

Joined
Dec 2, 2019
Messages
30
Hi there,
I just upgraded to truenas scale and I'm trying to get SMB connections to work in my VMs. I read in another post that you have to setup a bridge connection in order to make this work. However when I make a bridge connection and test it, the connection disappears after the test.
Any solutions to this? Because VMs are pretty much useless to me if I cannot use SMB.
 

morganL

Captain Morgan
Administrator
Moderator
iXsystems
Joined
Mar 10, 2018
Messages
2,694
Hi there,
I just upgraded to truenas scale and I'm trying to get SMB connections to work in my VMs. I read in another post that you have to setup a bridge connection in order to make this work. However when I make a bridge connection and test it, the connection disappears after the test.
Any solutions to this? Because VMs are pretty much useless to me if I cannot use SMB.
It would be useful to describe the bridge setup and IP addressing you are using.
Its often a config issue and I haven't seen other reports of bridges being broken...
There is a plan for better docs on this issue.
 

marpi822

Cadet
Joined
Apr 4, 2023
Messages
6
Hi, I have similar problem.

I have one NIC enp3s0, with static IP address 192.168.10.10/21.
I have tried to cerate a Bridge br0 interface with that interface (for share host to VM), but i have a problem.

1. I have removed IP address from enp3s0, (DHCP, ipv6 - disabled)
2. I have created new br0 Bridge interface (DHCP, ipv6 - disabled), added enp3s0 as bridge member, and static IP address 192.168.10.10/21
3. I have clicked test changes, and i cannot connect to my freenas GUI. For about one minute changes are reverted and everything looks like before interfaces modification.

On /var/log/messages I have:
Code:
TrueNAS Kernel: br0: port 1(enp3s0) entered blocking state
TrueNAS Kernel: br0: port 1(enp3s0) entered disabled state


Am i doing something wrong?
Is there somewhere in the logs I can find out what causes the problem of creating a bridge?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Did you first disable Hardware Offload on the NIC?
 

marpi822

Cadet
Joined
Apr 4, 2023
Messages
6
Did you first disable Hardware Offload on the NIC?

Could you please tell me how can i do this?
In configuration card of enp3s0 interface I do not have such an option.

TrueNAS-SCALE-22.12.1
Screenshot_2023-04-05-14-58-42-775-edit_com.android.chrome.jpg
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I see you have a 21 bit subnet mask... that's not "usual", so perhaps is something that takes a bit more testing time to be set.

Can you extend the test to 120 seconds and see if that helps?
 

marpi822

Cadet
Joined
Apr 4, 2023
Messages
6
I see you have a 21 bit subnet mask... that's not "usual", so perhaps is something that takes a bit more testing time to be set.

Can you extend the test to 120 seconds and see if that helps?
I have tested 10min, and it
 

marpi822

Cadet
Joined
Apr 4, 2023
Messages
6
I have tested 10min, and it

I tested by changing the timeout from 60s to 600s - not helped. I also checked by setting the address 192.168.20.5/24 from another network that I joined another computer, also without success.
 

marpi822

Cadet
Joined
Apr 4, 2023
Messages
6
I even tried creating an empty bridge (no bridge member, no IP address), test, and save. Then remove the IP address from the enp3s0 interface, add IP and bridge member to bridge interface. And test. But it also had no effect. With no connection to TrueNAS GUI to save the settings
 

marpi822

Cadet
Joined
Apr 4, 2023
Messages
6
I finally managed to create a bridge.

I think some problem was working VM's with assigned VM NIC to enp3s0. When I stopped the virtual machines, the bridge was successfully created, I was able to connect to the TrueNAS GUI without any problems and accept the new settings.

After creating the bridge, I updated the NIC settings for the VMs and have started them again.
 

marcnz

Cadet
Joined
Dec 23, 2023
Messages
4
If someone still has an issue with accessing the Truenas Host from a Truenas VM, here is the way to have a bridge that actually works from "Haydn-San" (thank you for your great video...):
https://youtu.be/7clQw132w58?si=cPvkXd35gE8L-H4v

This worked for me very well. I now can access the samba share folders in my Truenas host from my Windoze VMs! It was such a struggle following these posts. None were working. And I remembered from setting network bridge manually in Linux for the QEMU Windows virtual machine, what I read seemed wrong. And it was.

Power down all your VMs. Stop all your running Applications.

In summary:
1. Create a bridge interface. Don't put any static IP to it just yet and don't bind any existing network interface either.
2. Save, Test and Save.

Now this is where I struggled from all what I read in the Truenas community forum... And this is how it worked for me based on the video from "Haydn-San".

3. Edit your existing network interface (not the bridge...)
4. Remove any static IP you might have set up
5. Uncheck DHCP if it was checked
6. Click Save BUT DO NOT TEST!
7. Edit your bridge connection
8. Select your network interface in the Bridge Member selection
9. Add your static IP address in the Aliases bottom section
10. Save
11. Test and Save

In the VM:
1. Remove the extra NIC device if you have added the bridge previously
2. Edit the original NIC device
3. Select the bridge connection in the NIC device
4. Start the VM

Now within the VM, you should be able to ping the Truenas host IP address successfully and browse the samba shared network folders.

I hope this helps other people.
 

proxorp

Cadet
Joined
Jan 23, 2024
Messages
1
Adding a small updated to marcnz's very helpful post above.

In step 4 above, I was unable to remove the static IP of the interface as noted . TN wouldn't allow me to save when I deleted the IP of my interface. I'd click the save button and the button would go dark, but the config wouldn't return to the main network screen. I'd need to click the X to close the dialog and the IP is still unchanged (my changes didn't save).

I was able to work around this problem by clicking on "Reset Configuration" of the interface and THEN editing the interface to remove the IP address. It then correctly saved the interface with no IP and I could continue down marcnz's instruction list and was able to get my Virtualizations to access my TN server. Now things continued down the steps. Hope this helps someone down the line.

FWIW, other random lessons on my journey to finally get VM to talk to TN server...

Another realization that helped me make progress is when I understood that you shouldn't "Test Changes" after every network change you make. The instructions above to make all the changes to the Interface and THEN test changes is key. Once I understood this things made more sense and things started working. Make all the network changes you needed, THEN test changes one time at the end.

Also, I was real nervous about making changes on my main interface for fear of getting locked out by a bad network config. That hasn't happened yet, and I think the TN devs have done a good job of mitigating that risk with the "Test Changes" feature.

Another lesson I learned is to not use DHCP on the interfaces. I struggled way too long with that variable. So if you are having issues, get rid of DHCP and go static IPs.

Also, when I first created the bridge and did the Test Changes, it really did seem to take a while to complete the test so the changes could be saved. I had been impatient in some of my testing and manually changed the Test time from 60 to 30 sec. While most of the time the tests take less than 30 sec to complete, I now think that there really could be tests that needs more than 30 sec, so be aware. I've also seen other posts where the dev suggest trying longer than 60s test time, fwiw.

Another area where I burned a lot of time was not realizing that TN doesn't support two network interfaces on the same subnet. So if you have a PCI NIC and a motherboard NIC, don't try and get cute by thinking you can connect them both to your switch/router and have two IP on the same subnet on TN so you'll have a backup IP for access. For example, the config dialog clearly says that only one DHCP is allowed, so when you check DHCP on one interface, it will uncheck the DHCP on the other interface you may have. My advice for noobs, don't try using multiple NIC interfaces HW on TN until you get all the other networking basics working first.

Another dead end path I hit was trying to pass through a 2nd NIC to the virtual machine (instead of doing the Bridge method above). If you try and get an error like this...

[EFAULT] internal error: qemu unexpectedly closed the monitor: 2024-01-23T20:53:57.438531Z qemu-system-x86_64: -device {"driver":"vfio-pci","host":"0000:05:00.0","id":"hostdev0","bus":"pci.0","addr":"0x7"}: vfio 0000:05:00.0: group 13 is not viable Please ensure all devices within the iommu_group are bound to their vfio bus driver.

It is because the PCI deive (NIC) shares IOMMC space with other PCIe cards and can't be individually passed through to the VM unless resolved. The rabbit hole to work around that was too deep for my pea brain. Good luck, should be be brave enough to proceed on this issue.
 
Top