I am currently learning a bit about FreeBSD with the goal of moving my server from Debian to FreeBSD. Currently I am working on running some applications (e.g. Nextcloud) in jails. Services that are needed by multiple applications I want to outsource to own Jails, an example would be Redis.
I use Bastille to manage my jails, as I really like the templating system. The network is created in "loopback design". I have accordingly the vtnet0 interface of the server as well as the bastille0 interface.
I have now set up a Redis jail (IP e.g. 10.10.10.10) and other jails should be able to connect to it on port 6379. The port should only be accessible internally, not externally via the Internet. Currently I have used the following rules for this:
With this the communication works so far and I can access the port from the host / from other jails. I just wanted to ask if this is the right way to enable such an internal communication between jails, because I haven't found anything in this direction on the internet yet.
I use Bastille to manage my jails, as I really like the templating system. The network is created in "loopback design". I have accordingly the vtnet0 interface of the server as well as the bastille0 interface.
I have now set up a Redis jail (IP e.g. 10.10.10.10) and other jails should be able to connect to it on port 6379. The port should only be accessible internally, not externally via the Internet. Currently I have used the following rules for this:
Code:
[...]
$ext_if="vnet0"
nat on $ext_if from <jails> to any -> ($ext_if:0)
rdr-anchor "rdr/*"
[...]
pass in quick on "bastille0" proto tcp from { "10.10.10.0/24" } to { "10.10.10.10/24" } port 6379 keep state
pass out quick on "bastille0" proto tcp from { "10.10.10.10/24" } to { "10.10.10.0/24" } port 6379 keep state
[...]
With this the communication works so far and I can access the port from the host / from other jails. I just wanted to ask if this is the right way to enable such an internal communication between jails, because I haven't found anything in this direction on the internet yet.