jails in different private subnets on the same host

Bjoern A. Zeeb bzeeb-lists at lists.zabbadoz.net
Wed May 18 14:12:18 UTC 2016


> On 18 May 2016, at 14:00 , Grzegorz Junka <list1 at gjunka.com> wrote:
> 
> Is it possible to have two jails on the same host each one in a different private subnet, e.g. 192.168.1.0 and 10.33.1.0, and have routing between them working without issues?
> 
> I know it's possible to run jails with IPs in those two subnets but it seems there is no routing and I am not sure if it's because I can't configure my router properly or there is a more fundamental problem. One issue I see is that the jail can't have a different default gateway than the host, and that for now is 192.168.1.1, but I don't see a reason why 10.33.1.0 wouldn't be able to use 192.168.1.1 as it's default gateway provided there is routing between those two subnets.

Given they are both on the same base system host,  both addresses are connected locally and thus the kernel knows where to deliver these packets.  If that doesn’t work, there is a bug somewhere.

If you want different default gateways then you may want to look into using different FIBs for different jails.  See route(8) and jail(8) for parameters to set and tune.

/bz



More information about the freebsd-jail mailing list