Solved How to show IP addresses of all jails

When I run iocage list I'm only told the state, up or down.

Is there any way to display the IP address.

ChatGPT shows this

Code:
+-----+--------+-------+--------------+--------------+
| JID | NAME   | STATE | IPV4         | IPV6         |
+-----+--------+-------+--------------+--------------+
| 1   | web1   | up    | 192.168.1.10 | -            |
| 2   | db1    | up    | 192.168.1.11 | -            |
+-----+--------+-------+--------------+--------------+
 

The below may not work if your jail's are running behind a version but you can give this a try.



EDIT: I'm sorry. I missed the part about using iocage. I'm sorry, the above will not work with iocage.

It seems that IOCAGE works very differently to other jails.

I can achieve what I want by writing a script using jls and the parsing the output to run jexec JID ifconfig and parsing that, but I thought there may be something ready made.

Maybe there is some configuration paramater for the fields output by iocage list.
 
Many thanks to T-Daemon for pointing out something I hadn't noticed and that I could use iocage list -l which gives me what I need.

ps. I noticed iocage list -PRO which looks quite interesting.
 
Back
Top