aboutsummaryrefslogtreecommitdiffstats
path: root/templates/jail_confs/ingress.j2
diff options
context:
space:
mode:
authorJan Tuomi <jan@jantuomi.fi>2025-12-24 18:26:16 +0200
committerJan Tuomi <jan@jantuomi.fi>2025-12-24 18:26:16 +0200
commita8b7aaff8d89a0933a3abd70426dd2ec465425eb (patch)
treecd3b23eca7e5b112c5239ca403474fb123163f11 /templates/jail_confs/ingress.j2
parentd77e686d06916156700c5f298b5edb4ba3e9642b (diff)
Refactor jail.conf.d template
Diffstat (limited to 'templates/jail_confs/ingress.j2')
-rw-r--r--templates/jail_confs/ingress.j215
1 files changed, 15 insertions, 0 deletions
diff --git a/templates/jail_confs/ingress.j2 b/templates/jail_confs/ingress.j2
new file mode 100644
index 0000000..d6e4cad
--- /dev/null
+++ b/templates/jail_confs/ingress.j2
@@ -0,0 +1,15 @@
+devfs_ruleset = 6;
+
+{% include 'jail_confs/_epl_network.j2' %}
+
+exec.prestart += "ifconfig epair{{ jail.num }}001 create || echo 'Failed to create epair{{ jail.num }}001'";
+exec.prestart += "ifconfig epair{{ jail.num }}001a name epw1a";
+exec.prestart += "ifconfig epair{{ jail.num }}001b name epw1b";
+exec.prestart += "ifconfig brwan0 addm epw{{ jail.num }}a";
+
+exec.poststart += "ifconfig epw{{ jail.num }}b vnet ${name}";
+exec.poststart += "jexec ${name} ifconfig epw{{ jail.num }}b up";
+exec.poststart += "ifconfig epw{{ jail.num }}a up";
+exec.poststart += "jexec ${name} service dhclient restart epw{{ jail.num }}b";
+
+exec.poststop += "ifconfig epw{{ jail.num }}a destroy";