# Ezjail with random IP?



## cen1 (Mar 18, 2016)

I have cloned a local interface and I am creating jails like this:
`ezjail-admin create -f base slave1 'lo1|192.168.0.2'`

Is there a way for ezjail-admin() to assign the IP automatically without me specifying it? I don't really care what IP it is, it can be anything from /16 subnet. I will be creating jails programmatically and I don't really want to keep track of IPs in my system and increment them myself. Docker solves this on it's own and I'd like to replicate the behavior.


----------



## chrbr (Mar 19, 2016)

A work around might be to do this by your software. Just parse the jails listed in /usr/local/etc/ezjail/ and let your software find a free IP.


----------



## cen1 (Mar 20, 2016)

chrbr said:


> A work around might be to do this by your software. Just parse the jails listed in /usr/local/etc/ezjail/ and let your software find a free IP.


If you read my post this is exactly what I want to avoid doing.

But I guess it's the only way.


----------

