diff --git a/ansible/environments/home/host_vars/homeserver b/ansible/environments/home/host_vars/homeserver index eb1c270..b34f9bc 100644 --- a/ansible/environments/home/host_vars/homeserver +++ b/ansible/environments/home/host_vars/homeserver @@ -10,6 +10,7 @@ pflog_conf: network_rc: "homeserver_network.conf" rc_conf: "homeserver_rc.conf" loader_conf: "homeserver_loader.conf" +netgraph_config: "setup_netgraph_homeserver" cputype: "intel" cpu_opt: broadwell hwpstate: false diff --git a/ansible/roles/jail/files/setup_netgraph_homeserver b/ansible/roles/jail/files/setup_netgraph_homeserver new file mode 100644 index 0000000..1a0cef7 --- /dev/null +++ b/ansible/roles/jail/files/setup_netgraph_homeserver @@ -0,0 +1,87 @@ +#!/usr/local/bin/bash + +cleanup() { + ngctl shutdown host_link2: + ngctl shutdown host_uplink0: + ngctl shutdown host_bridge0: + ngctl shutdown wg_link2: + ngctl shutdown wg_uplink0: + ngctl shutdown wg_bridge0: + ngctl shutdown host_link3: + ngctl shutdown host_uplink1: + ngctl shutdown host_bridge1: +} + +setup_netgraph_start() { + cleanup + + # Create a bridge for jails that only speak wireguard + ngctl -d -f - <&2 echo "Unrecognized command" +fi