Is there a way in Truenas to set a preferred IP for Truenas services?
I’ve been debugging the following issue all day :
You can assign an IP address to a docker container. I thought it was a good idea to give Nginx Proxy Manager it’s own IP 10.0.10.4. To do so, you have to create a bridge and add it there.
Truenas itself is running on 10.0.10.6 (same bridge)
I have a site-to-site VPN in Unifi for doing some backups. The only allowed IP to reach out is 10.0.10.6.
And today, after rebooting and updating Truenas and Unifi, Truenas decided to reach out to my VPN over 10.0.10.4. And it failed, of course.
So I can assign multiple IP addresses to a bridge in Truenas, but how do I make sure that it uses a certain IP address for specific things?
I did learn a lesson today. Never update Truenas and Unifi at the same time, because if anything fails, you’re gonna search in the wrong place.
I’m not sure about this, but it is probably how I would approaching testing… Could you use a second physical connection for you containers? Then there would be no bridge for 10.0.10.6 to reach out on.
Well, I could, but I’m not sure if it would do anything.
Let’s assume that you have enp0 en enp1.
How would you tell Truenas to use enp0 for all ‘normal’ connections?
There is only a default gateway, but if enp0 and enp1 both have an IP in that subnet, nothing is keeping Truenas from choosing one or the other. And you need to assign it an IP if you want to use it in docker containers.
I have temporarily switched back to running Nginx Proxy Manager in a VM. But all suggestions are welcome! I sometimes really think that the networking in Truenas somewhat limited.
Well, in their defense, it is a storage device. In Core (long ago) I thought there was a way to restrict which connections do what, I had a VM set up probably 8 years ago and think I had it tied to a second connection. Could be wrong though.
As far as I know TrueNAS will default to the primary IP and for IP’s assigned to containers they will respond from their IP only when something is request to that IP.
I see, I’ve looked it up in the documentation and it states this:
By default, TrueNAS configures the primary network interface for Dynamic Host Configuration Protocol (DHCP) IP address management during installation.
But my primary network interface is actually not connected. And both primary and secondary interface are bridged, and IP aliases are added. Any suggestions on how/where to add a primary IP (10.0.0.6 and 10.0.10.6)?