From ab31d4eb2ffb2a8d1aa96acb51ee568725386621 Mon Sep 17 00:00:00 2001
From: JoeServ <bousset.rudy@gmail.com>
Date: Tue, 28 Feb 2023 18:46:08 +0100
Subject: up

---
 etc/jail.conf | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 etc/rc.conf   |  6 ++---
 2 files changed, 73 insertions(+), 3 deletions(-)
 create mode 100644 etc/jail.conf

(limited to 'etc')

diff --git a/etc/jail.conf b/etc/jail.conf
new file mode 100644
index 0000000..3cd95cf
--- /dev/null
+++ b/etc/jail.conf
@@ -0,0 +1,70 @@
+exec.start		= "/bin/sh /etc/rc";
+exec.stop		= "/bin/sh /etc/rc.shutdown jail";
+exec.clean;
+path			= "/var/jail/${name}";
+host.hostname		= ${name};
+mount.devfs;
+allow.mount.tmpfs;
+
+www {
+    $id		= 1;
+    $ipaddr	= 95.179.223.82;
+    $netmask	= 255.255.255.255;
+    $gw		= 10.0.0.254;
+    jid		= ${id};
+    ip4.addr	= ${ipaddr};
+}
+
+git {
+    $id		= 2;
+    $ipaddr	= 95.179.223.82;
+    $netmask	= 255.255.255.255;
+    $gw		= 10.0.0.254;
+    jid		= ${id};
+    ip4.addr	= ${ipaddr};
+}
+
+i2p {
+    $id		= 3;
+    $ipaddr	= 95.179.223.82;
+    $netmask	= 255.255.255.255;
+    $gw		= 10.0.0.254;
+    jid		= ${id};
+    ip4.addr	= ${ipaddr};
+}
+
+wireguard {
+    $id		= 4;
+    $ipaddr	= 10.0.0.${id};
+    $netmask	= 255.255.255.255;
+    $gw		= 10.0.0.254;
+    jid		= ${id};
+    vnet;
+    vnet.interface	 = "epair${id}b";
+    allow.raw_sockets;
+
+    exec.prestart	 = "ifconfig epair${id} create up";
+    exec.prestart	+= "ifconfig epair${id}a up descr vnet-${name}";
+    exec.prestart	+= "ifconfig bridge0 addm epair${id}a up";
+
+    exec.start		 = "/sbin/ifconfig lo0 127.0.0.1 up";
+    exec.start		+= "/sbin/ifconfig epair${id}b inet ${ipaddr} netmask ${netmask}";
+    exec.start		+= "/sbin/route add default ${gw}";
+    exec.start		+= "/bin/sh /etc/rc";
+
+    exec.prestop	 = "ifconfig epair${id}b -vnet ${name}";
+
+    exec.poststop	 = "ifconfig bridge0 deletem epair${id}a";
+    exec.poststop	+= "ifconfig epair${id}a destroy";
+}
+#    vnet;
+#    devfs_ruleset = "5";
+#    vnet.interface = "vn0_wireguard";
+#    exec.prestart += "jib addm wireguard vtnet0";
+#    exec.poststop += "jib destroy wireguard";
+#    #exec.start += "echo epair0b";
+#    #ip4.addr = 95.179.223.82;
+
+#nextcloud {
+#    ip4.addr = 95.179.223.82;
+#}
diff --git a/etc/rc.conf b/etc/rc.conf
index c96e4a5..16cb503 100644
--- a/etc/rc.conf
+++ b/etc/rc.conf
@@ -20,11 +20,11 @@ ifconfig_vtnet0="DHCP -rxcsum -tso"
 cron_flags="-m ''"
 jail_enable="YES"
 gateway_enable="YES"
-static_routes="net1"
-route_net1="-net 10.0.0.0/24 95.179.223.82"
+#static_routes="net1"
+#route_net1="-net 10.0.0.0/24 95.179.223.82"
 kld_list="if_bridge if_tap if_epair"
 cloned_interfaces="bridge0"
-ifconfig_bridge0="inet 10.0.0.254/24"
+ifconfig_bridge0="inet 10.0.0.254 netmask 255.255.255.0 descr jails-bridge"
 #cloned_interfaces="bridge0 epair0"
 #ifconfig_bridge0="addm vtnet0 addm epair0a up"
 #ifconfig_epair0a="up"
-- 
cgit v1.2.3