tty23: Thank you for the information, it was very helpful.
I've made a patch to the 8.1-RELEASE-p1 /etc/rc.d/jail script which allows both normal and vimage jails to work side by side on my system.
# diff /root/original_rc.d_jail /etc/rc.d/jail
Code:
638,639c638,644
< eval ${_setfib} jail ${_flags} -i ${_rootdir} ${_hostname} \
< \"${_addrl}\" ${_exec_start} > ${_tmp_jail} 2>&1
---
> if [ -z "${_addrl}" ] ; then
> eval ${_setfib} jail -i ${_flags} path=${_rootdir} host.hostname=${_hostname} \
> command=${_exec_start} > ${_tmp_jail} 2>&1
> else
> eval ${_setfib} jail -i ${_flags} ${_rootdir} ${_hostname} \
> \"${_addrl}\" ${_exec_start} > ${_tmp_jail} 2>&1
> fi
While this patch may be useful to some people, I think it might be a too dirty hack to apply to the default release.
However, I do believe that the automatic startup of jails should use the new named parameters instead of the depreciated flags.. This is probably getting offtopic for this thread though.
Back on topic:
The hosts networking is configured as such:
/etc/rc.conf
Code:
...
cloned_interfaces="vlan0 vlan1 bridge0"
ifconfig_em0="up mtu 9000 polling"
ifconfig_vlan0="inet n.n.n.n/nn vlan n vlandev em0 name lanif"
ifconfig_vlan1="up vlan nn vlandev em0 name jailif up"
ifconfig_bridge0="inet n.n.n.n/nn name jailbridge mtu 9000 addm jailif"
I've altered my ezjail configuration as follows:
/usr/local/etc/ezjail/jailname
Code:
#vnet stuff
export jail_jailname_flags="-c vnet name=jailname"
export jail_jailname_exec_prestart0="ifconfig epair0 create mtu 9000"
export jail_jailname_exec_prestart1="ifconfig jailbridge addm epair0a"
export jail_jailname_exec_prestart2="ifconfig epair0a up"
export jail_jailname_exec_poststart0="ifconfig epair0b vnet jailname"
export jail_jailname_exec_poststart1="jexec jailname /bin/sh /etc/rc.d/netif start"
export jail_jailname_exec_poststart2="jexec jailname /bin/sh /etc/rc.d/routing start"
export jail_jailname_exec_poststart3="jexec jailname /bin/sh /etc/rc"
export jail_jailname_exec_poststop0="ifconfig jailbridge deletem epair0a"
export jail_jailname_exec_poststop1="ifconfig epair0a destroy"
#end vnet stuff
And I've altered the jails /etc/rc.conf to define ip/subnet/name & default router.
Everything seems to work flawlessly at the moment.
