I've created a few jails that only have private network addresses on lo1 (I keep lo1 to jails only).
To me it seems that the 'normal' Unix loopback IPv4 interface 127.0.0.1 is available only on the host running the jails, but not inside the jails. Some programs fail to work the normal way when you enable them to listen on 127.1. Yes, I can always use the jail private network interface (10.0.0.x in my case), but that way the jail needs to know its loopback address which I find not a good abstraction. Shouldn't a jail as self-contained virtual host have its own loopback interface with a 127.1 and ::1 address?
Usually those jails should not be able to communicate to each other so I enabled pf rules to prevent traffic from and to their private network. But now I had the problem to create a rule for each jail so it could reach itself, I only have a few jails, but it does not look right to do it this way. Would be much easier with a loopback interface 127.1, ::1 for each jail.
Am I missing something? I'm new to FreeBSD, so sorry if I missed something.
So the rules look like:
Best, Patrick aka Jolly
To me it seems that the 'normal' Unix loopback IPv4 interface 127.0.0.1 is available only on the host running the jails, but not inside the jails. Some programs fail to work the normal way when you enable them to listen on 127.1. Yes, I can always use the jail private network interface (10.0.0.x in my case), but that way the jail needs to know its loopback address which I find not a good abstraction. Shouldn't a jail as self-contained virtual host have its own loopback interface with a 127.1 and ::1 address?
Usually those jails should not be able to communicate to each other so I enabled pf rules to prevent traffic from and to their private network. But now I had the problem to create a rule for each jail so it could reach itself, I only have a few jails, but it does not look right to do it this way. Would be much easier with a loopback interface 127.1, ::1 for each jail.
Am I missing something? I'm new to FreeBSD, so sorry if I missed something.
So the rules look like:
Code:
....
block all
pass quick on lo0
#rules to keep each jail be accessible for itself
pass quick on lo1 from 10.0.0.1 to 10.0.0.1
pass quick on lo1 from 10.0.0.2 to 10.0.0.2
pass quick on lo1 from 10.0.0.3 to 10.0.0.3
pass quick on lo1 from 10.0.0.4 to 10.0.0.4
pass quick on lo1 from 10.0.0.5 to 10.0.0.5
pass quick on lo1 from 10.0.0.6 to 10.0.0.6
...
# rules so one jail can access another on specific ports
pass quick on lo1 proto tcp from 10.0.0.5 to 10.0.0.2 port 80 keep state
pass quick on lo1 proto tcp from 10.0.0.5 to 10.0.0.6 port 80 keep state
Best, Patrick aka Jolly