Hello forum.
I'm playing around with FreeBSD jails for the first time on 10.1-RELEASE and I'm trying to work out the best way of configuring the localhost interface within the jails.
As I understand it, I can either configure each jail's lo0 interface with a unique 127.x.y.z/8 address, or I can configure them all to share 127.0.0.1 with the main host.
The benefit of the latter method would be that any services running on the main host that listen on 127.0.0.1 will be reachable from the jails as well. This could let all jails use the same local resolver, rather than each running their own instance. Or, a web server running in a jail would be able to talk to a MySQL server running in another jail, or on the main host.
The drawback of this is that if processes running on the main host and inside the jails try to bind to the same port on 127.0.0.1, the jailed processes will fail. Obviously, this can be avoided with careful configuration.
The drawback of using unique loopback addresses in each jail is that they can't seem to send traffic to other loopback addresses.
I was wondering how other FreeBSD jail users approach this issue. Is there an established best practice for this?
I'm playing around with FreeBSD jails for the first time on 10.1-RELEASE and I'm trying to work out the best way of configuring the localhost interface within the jails.
As I understand it, I can either configure each jail's lo0 interface with a unique 127.x.y.z/8 address, or I can configure them all to share 127.0.0.1 with the main host.
The benefit of the latter method would be that any services running on the main host that listen on 127.0.0.1 will be reachable from the jails as well. This could let all jails use the same local resolver, rather than each running their own instance. Or, a web server running in a jail would be able to talk to a MySQL server running in another jail, or on the main host.
The drawback of this is that if processes running on the main host and inside the jails try to bind to the same port on 127.0.0.1, the jailed processes will fail. Obviously, this can be avoided with careful configuration.
The drawback of using unique loopback addresses in each jail is that they can't seem to send traffic to other loopback addresses.
I was wondering how other FreeBSD jail users approach this issue. Is there an established best practice for this?