#!/bin/sh for i in `seq 1 100` do echo "running for $i time" # Clone jail zfs dataset and create the jail where 11jail is a stock FreeBSD 11/12 RELEASE/STABLE/CURRENT/ jail respectively zfs clone zroot/jails/11jail@base zroot/jails/jail1 jail -c path=/jails/jail1 host.hostname=jail1 persist=true name=jail1 vnet # Create and rename epair interfaces and add to jail ifconfig epair create ifconfig epair0a name jail1_a ifconfig epair0b name jail1_b ifconfig jail1_a up ifconfig jail1_b vnet jail1 jexec jail1 ifconfig jail1_b inet 192.168.1.1 netmask 255.255.255.0 up # Remove interface from jail and destroy epair, jail and zfs dataset. ifconfig jail1_b -vnet jail1 ifconfig jail1_a destroy jail -r jail1 zfs destroy -rf zroot/jails/jail1 echo "-----------------------" done