jails Assigning IP to Jail using DHCP and allow.raw_sockets, with base toolkit.

Previous discussion about the topic concluded in that apparently is possible, but have no given any guide to how to do it. And I have not found much about how to do it.

Therefore, does anyone know how to do it?

I think that probably
Code:
kubernetes {
exec.start = "/bin/sh /etc/rc";
exec.consolelog = "/var/log/jail_console_${name}.log";

allow.raw_sockets;
exec.clean;
mount.devfs;
securelevel = 2;
enforce_statfs = 2;
devfs_ruleset = 5;

path = "/jails/${name}";
host.hostname = "${name}";

$id = "71";
$ip = "192.168.0.${id}/24";
$gateway = "192.168.0.1";
$bridge = "bridge0";
$epair = "epair${id}";

vnet;
vnet.interface = "${epair}b";

exec.prestart  = "/sbin/ifconfig ${epair} create up";
exec.prestart += "/sbin/ifconfig ${epair}a up descr jail:${name}";
exec.prestart += "/sbin/ifconfig ${bridge} addm ${epair}a up";
exec.stop     += "/bin/sh /etc/rc.shutdown";
exec.poststop = "/sbin/ifconfig ${bridge} deletem ${epair}a";
exec.poststop += "/sbin/ifconfig ${epair}a destroy";
}

with does not have internet not an IP, but I think that probably it should only need to do whatever you do to manually trigger dhcp in the host, as raw sockets are already allowed (maybe I have to allow privileged ports), but have not found any of how to manually do.

I have tried ifconfig -j kubernetes epair71b up dhcp, it gives me invalid command. Similar history with ifconfig -j kubernetes epair71b inet DHCP as in https://forums.freebsd.org/threads/trying-to-set-up-a-network-bridge-for-dhcp.20287/. But have not found anything.
 
What does your /etc/rc.conf file look like.
For my host it is:
Code:
clear_tmp_enable="YES"
syslogd_flags="-ss"
hostname="localhost"
keymap="en_US.kbd"
ifconfig_re0="DHCP"
sshd_enable="YES"
moused_enable="YES"
ntpd_enable="YES"
ntpd_sync_on_start="YES"
powerd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
zfs_enable="YES"
And for the jail it is:
Code:
moused_nondefault_enable="NO"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
Sorry for the unacceptable tardyness.
 
Where is your jail setup stuff in the /etc/rc.conf file? For example, my /etc/rc.conf includes this:

Code:
# JAILS
jail_enable="YES"
jail_parallel_start="YES"
jail_list="jailname jailname jailname"
 
Where is your jail setup stuff in the /etc/rc.conf file? For example, my /etc/rc.conf includes this:

Code:
# JAILS
jail_enable="YES"
jail_parallel_start="YES"
jail_list="jailname jailname jailname"
I use jail -crm -f jail.conf with jail.conf files rather than having something in the host's /etc/rc.conf.
 
Back
Top