aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/etc_rc.conf.j216
-rw-r--r--templates/etc_resolv.conf.j22
-rw-r--r--templates/jail_confs/_epl_network.j25
-rw-r--r--templates/jail_confs/ingress.j25
4 files changed, 22 insertions, 6 deletions
diff --git a/templates/etc_rc.conf.j2 b/templates/etc_rc.conf.j2
index 6ee2583..5380056 100644
--- a/templates/etc_rc.conf.j2
+++ b/templates/etc_rc.conf.j2
@@ -8,13 +8,21 @@ moused_nondefault_enable="NO"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
zfs_enable="YES"
-defaultrouter="192.168.0.1"
+{% if is_test_vm %}
+defaultrouter="10.0.20.1"
+{% else %}
+defaultrouter="{{ lan_ipv4_gateway }}"
+{% endif %}
cloned_interfaces="bridge0 bridge1"
-ifconfig_igc0_name="lan0"
-ifconfig_igc1_name="wan0"
+ifconfig_{{ nic_lan }}_name="lan0"
+ifconfig_{{ nic_wan }}_name="wan0"
ifconfig_bridge0_name="brlan0"
ifconfig_bridge1_name="brwan0"
+{% if is_test_vm %}
+ifconfig_lan0="inet 10.0.20.2/24"
+{% else %}
ifconfig_lan0="inet {{ lan_ipv4_cidr }}"
+{% endif %}
ifconfig_lan0_ipv6="inet6 accept_rtadv"
ifconfig_wan0="up"
ifconfig_brlan0="addm lan0 up"
@@ -31,8 +39,10 @@ clear_tmp_enable="YES"
cleanvar_enable="YES"
auditd_enable="YES"
devd_enable="YES"
+{% if not is_test_vm %}
vm_enable="YES"
vm_dir="zfs:zroot/vm"
vm_list="alpine0"
vm_delay="5"
kld_list="if_wg i915kms"
+{% endif %}
diff --git a/templates/etc_resolv.conf.j2 b/templates/etc_resolv.conf.j2
index 9232f25..b382ecf 100644
--- a/templates/etc_resolv.conf.j2
+++ b/templates/etc_resolv.conf.j2
@@ -1,2 +1,2 @@
search {{ lan_search_domain }}
-nameserver {{ lan_ipv4_gateway }}
+nameserver {{ dns_nameserver | default(lan_ipv4_gateway) }}
diff --git a/templates/jail_confs/_epl_network.j2 b/templates/jail_confs/_epl_network.j2
index e80aebe..fa3744a 100644
--- a/templates/jail_confs/_epl_network.j2
+++ b/templates/jail_confs/_epl_network.j2
@@ -8,10 +8,11 @@ exec.prestart += "ifconfig brlan0 addm epl{{ jail.num }}a";
exec.poststart += "ifconfig epl{{ jail.num }}b vnet ${name}";
exec.poststart += "jexec ${name} ifconfig epl{{ jail.num }}b up";
exec.poststart += "ifconfig epl{{ jail.num }}a up";
-exec.poststart += "jexec ${name} ifconfig epl{{ jail.num }}b 192.168.2.{{ jail.num }}/16";
+exec.poststart += "jexec ${name} ifconfig epl{{ jail.num }}b {{ jail_lan_prefix }}.{{ jail.num + jail_ip_offset }}/{{ jail_lan_prefixlen }}";
exec.poststart += "jexec ${name} route delete default || echo 'No default route to delete'";
+{% if not is_test_vm %}
exec.poststart += "jexec ${name} route add 10.6.210.0/24 {{ lan_ipv4_gateway }} || echo 'Failed to add Wireguard return route'";
-
+{% endif %}
exec.poststop += "ifconfig epl{{ jail.num }}a destroy";
## _epl_network end
diff --git a/templates/jail_confs/ingress.j2 b/templates/jail_confs/ingress.j2
index 59db3f1..5964d06 100644
--- a/templates/jail_confs/ingress.j2
+++ b/templates/jail_confs/ingress.j2
@@ -10,7 +10,12 @@ 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";
+{% if is_test_vm %}
+exec.poststart += "jexec ${name} ifconfig epw{{ jail.num }}b inet 10.0.20.3/24";
+exec.poststart += "jexec ${name} route add default 10.0.20.1";
+{% else %}
exec.poststart += "jexec ${name} service dhclient restart epw{{ jail.num }}b";
+{% endif %}
exec.prestart += "mount -t nullfs /usr/local/jails/containers/goaccess/var/www/goaccess /usr/local/jails/containers/ingress/mnt/www_goaccess || echo 'Failed to mount'";
exec.poststop += "umount /usr/local/jails/containers/ingress/mnt/www_goaccess || echo 'Failed to umount'";