diff --git a/ansible/roles/bhyve/files/bhyve_netgraph_bridge.bash b/ansible/roles/bhyve/files/bhyve_netgraph_bridge.bash index a5e0ff8..ca90800 100644 --- a/ansible/roles/bhyve/files/bhyve_netgraph_bridge.bash +++ b/ansible/roles/bhyve/files/bhyve_netgraph_bridge.bash @@ -19,29 +19,109 @@ function main { function create_disk { zfs_path="$1" - gigabytes="$2" - zfs create "-V${gigabytes}G" -o volmode=dev "$zfs_path" + mount_path="$2" + gigabytes="$3" + zfs create -o "mountpoint=$mount_path" "$zfs_path" + cp /usr/local/share/edk2-bhyve/BHYVE_UEFI_VARS.fd "${mount_path}/" + tee "${mount_path}/settings" <&2 echo "No available links on bridge $bridge_name") + exit 1 + fi + done +} + +function assert_bridge { + host_interface_name="$1" + bridge_name="$2" + ip_range="$3" + + if ! ng_exists "${bridge_name}:"; then + ngctl -d -f - </dev/null 2>&1 +} + + main "${@}" diff --git a/ansible/roles/firewall/files/odofreebsd_pf.conf b/ansible/roles/firewall/files/odofreebsd_pf.conf index 89f1832..95897f9 100644 --- a/ansible/roles/firewall/files/odofreebsd_pf.conf +++ b/ansible/roles/firewall/files/odofreebsd_pf.conf @@ -22,7 +22,10 @@ rdr pass on $not_ext_if proto {tcp, udp} from any to 10.215.1.1 port 53 -> 1.1.1 # filtering block log all pass out on $ext_if + pass in on jail_nat +# Allow traffic from my machine to the jails/virtual machines +pass out on jail_nat from jail_nat # We pass on the interfaces listed in allow rather than skipping on # them because changes to pass rules will update when running a