I'm trying to set up "vnet" jailed bhyve VMs which can talk to each other.
Below is my jail .conf file:
Note: the jails do not have access to the hardware interface card (ie. no access to "em0")
The booted OS inside the jail does indeed have an IP address assigned to tap100, but the problem is it is not reacheable from the (FreeBSD) host or other bhyve VMs. In the (FreeBSD) host, the IP address of the bhyve VM does not appear either.
I suppose the IP address needs to "appear" in the host, in order for the host and VMs to communicate between each other. How can I do that?
Below is my jail .conf file:
Code:
jailname100 {
$if = 100;
exec.prestart = "/sbin/ifconfig epair${if} create up";
exec.prestart += "/sbin/ifconfig epair${if}a up";
exec.prestart += "/sbin/ifconfig epair${if}a name ${name}";
exec.prestart += "/sbin/ifconfig epair${if}b name jail${if}";
exec.prestart += "/sbin/ifconfig bridge0 addm ${name}";
exec.prestart += "/sbin/ifconfig tap${if} create up";
exec.prestart += "/sbin/ifconfig bridge0 addm tap${if}";
exec.prestart += "/sbin/sysctl net.inet.ip.forwarding=1";
exec.clean;
host.hostname = "${name}";
vnet;
vnet.interface = "tap${if}";
path = "/myjails/containers/${name}";
allow.vmm;
allow.mount;
mount.devfs;
devfs_ruleset=100;
persist;
exec.start += "/bin/sh /etc/rc";
exec.stop = "/bin/sh /etc/rc.shutdown";
exec.poststop += "/sbin/ifconfig ${name} destroy";
exec.poststop += "/sbin/ifconfig bridge0 deletem tap${if}";
exec.poststop += "/sbin/ifconfig tap${if} destroy";
exec.consolelog = "/var/log/jail_console_${name}.log";
}
Note: the jails do not have access to the hardware interface card (ie. no access to "em0")
The booted OS inside the jail does indeed have an IP address assigned to tap100, but the problem is it is not reacheable from the (FreeBSD) host or other bhyve VMs. In the (FreeBSD) host, the IP address of the bhyve VM does not appear either.
I suppose the IP address needs to "appear" in the host, in order for the host and VMs to communicate between each other. How can I do that?