Query about "iocage create ip4_addr=vnet0" i.e. the vnet part

Hazimil

Contributor
Joined
May 26, 2014
Messages
172
Hi

I've been reading up on iocage Jails, and some of the resources I have read recommend that vnet is the way to go, as "VNET provides more fine control and isolation for jails.". However, networking is not my strong point, and I was after a clarification on the ip4_addr=vnet0 part.

Code:
iocage create -n ClamAV ip4_addr="vnet0|192.168.0.105/24" -r 11.2-RELEASE vnet="on" allow.raw_sockets=”1” defaultrouter="192.168.0.1”


Do I create a new vnet for each jail, i.e. ip4_addr=vnet0, ip4_addr=vnet1, ip4_addr=vnet2, and onwards... etc. or is there a limit of the amount of vnet's available? Can more than once Jail share the same vnet, but with different IP address?

I know I can use the GUI to create the Jails, but like to understand a bit more about the process - it's all learning!

Yours
Jonathan
 

nojohnny101

Wizard
Joined
Dec 3, 2015
Messages
1,478
If you have multiple jails, then you don't need to specify the specific vnet interface during creation. I believe once you actually start each jail, iocage checks the networking stack to see if that particular vnet interface exists and if it does, it will increment.

I created many jails and assigned all of them "vnet0" during creation but when I look into the /var/log/messages, I can see they are assigned different vnet interfaces (vnet1,vnet2, etc.) upon startup. In fact I think it only resets on a full system reboot as I have seen vnet interfaces as high as vnet16 or so after I was doing some maintenance on some of the jails and kept restarting them (at which point they would get a new vnet interface).

This is just my experience and I'm not sure if I am explaining it well enough. Maybe someone else can chime in.
 

Hazimil

Contributor
Joined
May 26, 2014
Messages
172

Turgin

Dabbler
Joined
Feb 20, 2016
Messages
43
vnet0 is significant inside the jail only. Each jail would have a vnet0, but if any one jail needs more than one interface you could assign vnet0, vnet1, etc.
 
Top