aboutsummaryrefslogtreecommitdiffstats
path: root/templates/etc_jail.conf.j2
diff options
context:
space:
mode:
authorJan Tuomi <jan@jantuomi.fi>2025-10-06 00:06:54 +0300
committerJan Tuomi <jan@jantuomi.fi>2025-10-06 00:06:54 +0300
commitae9be6373428471dd4c95f64741b990638c272c0 (patch)
tree66211764ac0d8c5484e119b7b3f23ad56ebc5ea4 /templates/etc_jail.conf.j2
parentffe2c8d0accb5c33c98408dfb1039d7387ddffd1 (diff)
Work on networking
Diffstat (limited to 'templates/etc_jail.conf.j2')
-rw-r--r--templates/etc_jail.conf.j28
1 files changed, 6 insertions, 2 deletions
diff --git a/templates/etc_jail.conf.j2 b/templates/etc_jail.conf.j2
index 708e5c1..0b8c18b 100644
--- a/templates/etc_jail.conf.j2
+++ b/templates/etc_jail.conf.j2
@@ -12,7 +12,7 @@ exec.prestart += "ifconfig ${epl}a up";
exec.prestart += "ifconfig brlan0 addm ${epl}a";
exec.clean;
exec.start = "/bin/sh /etc/rc";
-exec.poststart = "jexec ${name} ifconfig ${epl}b 192.168.2.${num}/16";
+exec.poststart = "jexec ${name} ifconfig ${epl}b 192.168.2.${num}/16 up";
exec.poststart += "jexec ${name} route add default 192.168.0.1 || echo 'Failed to add default route'";
exec.stop = "/bin/sh /etc/rc.shutdown";
exec.poststop += "ifconfig ${epl}b -vnet $name"; # workaround to bug 238326: move ${epl}b from the jail to the host when stopping jail services
@@ -32,6 +32,10 @@ path = "/usr/local/jails/containers/${name}";
{% for jail in jails %}
{{ jail.name }} {
$num = "{{ jail.num }}";
+ {% if jail.name == "ingress" %}
+ exec.poststart = "jexec ${name} ifconfig ${epl}b 192.168.2.${num}/16 up";
+ exec.poststart = "jexec ${name} ifconfig epw1b up";
+ exec.poststart += "jexec ${name} service dhclient restart epw1b";
+ {% endif %}
}
-
{% endfor %}