I am new to jails (and not a networking specialist), and struggle to configure a VNET jail correctly with bastille. This is my jail setup:
The jail is created, along with the bridge (
With this configuration alone, the host cannot reach the jail, and the jail cannot reach the host (and the internet).
When I add an IP address from the jail subnet to
But from the jail, I cannot reach the internet (network unreachable). The host's public IP was set as
I can ping the
I did RTFM (FreeBSD handbook and Bastille documentation), but still cannot wrap my head around this. How can I get out of the jail and into the world?
Code:
bastille setup vnet
bastille create -V alcatraz 15.0-RC3 "192.168.0.24/24 fdb6:01b5:3992:e964::24/64" vtnet0
The jail is created, along with the bridge (
vtnet0bridge) and the epair ( e0a_alcatraz on the host, e0b_alcatraz as vnet0 in the jail (with the private IP subnets above). The host is configured as gateway ( sysrc gateway_enable="YES").With this configuration alone, the host cannot reach the jail, and the jail cannot reach the host (and the internet).
When I add an IP address from the jail subnet to
vtnet0bridge ( ifconfig vtnet0bridge inet 192.168.0.1/24), a connection to the jail ( ping 192.168.0.24) is possible with the following pf configuration:
Code:
vnet_if = "vtnet0bridge"
vnetnet = "192.168.0.0/24"
pass quick on $vnet_if inet from $vnetnet to any keep state
But from the jail, I cannot reach the internet (network unreachable). The host's public IP was set as
defaultrouter by bastille for the jail, so I tried setting it to the IP added to vtnet0bridge ( 192.168.0.1) and added a NAT rule to the host's pf configuration ( nat on $ext_if from $vnetnet to any -> ($ext_if) without success.I can ping the
192.168.0.1 (when this address is configured as defaultrouter), but not the host's public IP in the original setting (defaultrouter = host's public IP). /etc/rc.conf contains the following:
Code:
ifconfig_e0b_alcatraz_name="vnet0"
ifconfig_vnet0="inet 192.168.0.24/24"
ifconfig_vnet0_ipv6="inet6 -ifdisabled fdb6:01b5:3992:e964::24/64"
defaultrouter="192.168.0.1"
ipv6_defaultrouter="fe80::1%vtnet0"
I did RTFM (FreeBSD handbook and Bastille documentation), but still cannot wrap my head around this. How can I get out of the jail and into the world?