SOLVED VNET Jail on different subnet than host

leonardorame

Contributor
Joined
Jun 30, 2018
Messages
106
I'm trying to create a jail with vnet enabled, host IP is 192.168.1.155 on re0 and I would like the jail's ip 172.16.1.100.

My host is a TrueNAS-12.0-RELEASE.

Here's my config:

1604685885040.png


1604685909154.png


When I try to start the jail from de UI I get: Error: [EFAULT] Stopped PostgreSql due to VNET failure

Can you help me with this?
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
The IP address and default gateway have to be on the same network.

It is technically possible to create a jail on another network as you want, but the actual setup requires some advanced networking skill - which is beyond the scope of this forum.
 

leonardorame

Contributor
Joined
Jun 30, 2018
Messages
106
I was confused about networking in jails. I thought jails needed an IP, but finally I created one inheriting the ipv4 from the host.
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
Glad you worked through your problem. Sometimes, it makes sense to create a unique IP address for a jail - other times it doesn't matter. It really depends upon what you are doing.

But, unless you are prepared to set up some complex networking, even a unique IP address will be on the same network as the main system.
 
Top