Network configuration for multiple jails using same port binding

clang

Cadet
Joined
Oct 26, 2015
Messages
4
I am not sure if what I want to get is even possible, so I hope you can help me.

I have to physical NICs em0,igb0 combined to lagg0 (loadbalancing) with ip 192.168.1.20/24.

Then I have several jails
j1 192.168.1.21/24
j2 192.168.1.22/24
....

I would like to run a mqttbroker (e.g.) in each jail listening/binding on port 1883.
When starting mqttbroker in second jail I get the error binding already in use (probably because first mqttbroker in j1 is already in use in lagg0).

So far the scenario.
Is there anyway I can stay in my local network 192.168.1.0/24 with the jail IPs and can somehow emulate with VNET a NIC for each jail?
I have to admit I do not fully understand If I need to bridge somehow from the lagg0 to VNET[0/1/2..] or maybe need several Bridges etc.
I hope it was clear what I want to achieve.
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
You should create a bridge first with the lagg0 as the member before any jail creation so that physicalnicx2>lagg0>bridge0

This is apparently the FreeBSD default behaviour, but TrueNAS doesn’t do it for some reason.
 

clang

Cadet
Joined
Oct 26, 2015
Messages
4
When I try to create bridge0 with member lagg0 I can't set ip adress from 192.168.1.0/24 because it is already in use.
Do I have to set another network/ip?
"The network 192.168.1.x/24 is already in use by another interface."
 

clang

Cadet
Joined
Oct 26, 2015
Messages
4
Thanks for your advise. I was able to add the bridge0 (only with wenig IP associated) and remove IPs from lagg0.
In jails I set IPs with VNET enabled vnet_default= none, ipv4-if=empty and network-if=vnet0:bridge0.

So currently no issues.
Btw, I found out that moquitto.conf with minimal entries tries to start on any/all network interfaces which resulted in collisions..

I hope now it's correctly configured, but currently I don't see any issues.
 
Top