From c62b8ce04608250ced7d689f78027cfe21f8e9dc Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 7 Feb 2020 10:28:57 +0100 Subject: [PATCH] net/tayga: New plugin (#1673) --- README.md | 1 + net/tayga/Makefile | 7 +++ net/tayga/pkg-descr | 14 +++++ net/tayga/src/etc/inc/plugins.inc.d/tayga.inc | 63 +++++++++++++++++++ net/tayga/src/etc/rc.d/opnsense-tayga | 35 +++++++++++ .../OPNsense/Tayga/Api/GeneralController.php | 37 +++++++++++ .../OPNsense/Tayga/Api/ServiceController.php | 39 ++++++++++++ .../OPNsense/Tayga/GeneralController.php | 38 +++++++++++ .../OPNsense/Tayga/forms/general.xml | 32 ++++++++++ .../mvc/app/models/OPNsense/Tayga/ACL/ACL.xml | 9 +++ .../mvc/app/models/OPNsense/Tayga/General.php | 35 +++++++++++ .../mvc/app/models/OPNsense/Tayga/General.xml | 27 ++++++++ .../app/models/OPNsense/Tayga/Menu/Menu.xml | 5 ++ .../mvc/app/views/OPNsense/Tayga/general.volt | 61 ++++++++++++++++++ .../opnsense/scripts/OPNsense/Tayga/setup.sh | 5 ++ .../service/conf/actions.d/actions_tayga.conf | 23 +++++++ .../service/templates/OPNsense/Tayga/+TARGETS | 2 + .../service/templates/OPNsense/Tayga/tayga | 6 ++ .../templates/OPNsense/Tayga/tayga.conf | 11 ++++ 19 files changed, 450 insertions(+) create mode 100644 net/tayga/Makefile create mode 100644 net/tayga/pkg-descr create mode 100644 net/tayga/src/etc/inc/plugins.inc.d/tayga.inc create mode 100644 net/tayga/src/etc/rc.d/opnsense-tayga create mode 100644 net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/Api/GeneralController.php create mode 100644 net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/Api/ServiceController.php create mode 100644 net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/GeneralController.php create mode 100644 net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/forms/general.xml create mode 100644 net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/ACL/ACL.xml create mode 100644 net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/General.php create mode 100644 net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/General.xml create mode 100644 net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/Menu/Menu.xml create mode 100644 net/tayga/src/opnsense/mvc/app/views/OPNsense/Tayga/general.volt create mode 100644 net/tayga/src/opnsense/scripts/OPNsense/Tayga/setup.sh create mode 100644 net/tayga/src/opnsense/service/conf/actions.d/actions_tayga.conf create mode 100644 net/tayga/src/opnsense/service/templates/OPNsense/Tayga/+TARGETS create mode 100644 net/tayga/src/opnsense/service/templates/OPNsense/Tayga/tayga create mode 100644 net/tayga/src/opnsense/service/templates/OPNsense/Tayga/tayga.conf diff --git a/README.md b/README.md index a9e87c980..0f63d1085 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ net/pptp -- End of life, no replacement net/relayd -- Relayd Load Balancer net/shadowsocks -- Secure socks5 proxy net/siproxd -- Siproxd is a proxy daemon for the SIP protocol +net/tayga -- Tayga is a stateless NAT64 daemon net/upnp -- Universal Plug and Play Service net/vnstat -- vnStat is a console-based network traffic monitor net/wireguard -- WireGuard VPN service diff --git a/net/tayga/Makefile b/net/tayga/Makefile new file mode 100644 index 000000000..2799992bf --- /dev/null +++ b/net/tayga/Makefile @@ -0,0 +1,7 @@ +PLUGIN_NAME= tayga +PLUGIN_VERSION= 0.1 +PLUGIN_COMMENT= Tayga IPv6 64NAT +PLUGIN_DEPENDS= tayga +PLUGIN_MAINTAINER= m.muenz@gmail.com + +.include "../../Mk/plugins.mk" diff --git a/net/tayga/pkg-descr b/net/tayga/pkg-descr new file mode 100644 index 000000000..17dc5ca6c --- /dev/null +++ b/net/tayga/pkg-descr @@ -0,0 +1,14 @@ +TAYGA is an out-of-kernel stateless NAT64 implementation that uses +the TUN driver to exchange IPv4 and IPv6 packets with the kernel. +It is intended to provide production-quality NAT64 service for +networks where dedicated NAT64 hardware would be overkill. + + +Plugin Changelog +================ + +1.0 + +* Support for IPv6 prefix and IPv4 pool + +WWW: http://www.litech.org/tayga/ diff --git a/net/tayga/src/etc/inc/plugins.inc.d/tayga.inc b/net/tayga/src/etc/inc/plugins.inc.d/tayga.inc new file mode 100644 index 000000000..9938b03cf --- /dev/null +++ b/net/tayga/src/etc/inc/plugins.inc.d/tayga.inc @@ -0,0 +1,63 @@ + + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +function tayga_enabled() +{ + $model = new \OPNsense\Tayga\General(); + + return (string)$model->enabled == '1'; +} + +function tayga_services() +{ + $services = array(); + + if (tayga_enabled()) { + $services[] = array( + 'description' => gettext('Tayga'), + 'configd' => array( + 'restart' => array('tayga restart'), + 'start' => array('tayga start'), + 'stop' => array('tayga stop'), + ), + 'name' => 'tayga', + 'pidfile' => '/var/run/tayga.pid' + ); + } + + return $services; +} + +function tayga_xmlrpc_sync() +{ + $result = array(); + $result['id'] = 'taygavpn'; + $result['section'] = 'OPNsense.tayga'; + $result['description'] = gettext('Tayga'); + return array($result); +} diff --git a/net/tayga/src/etc/rc.d/opnsense-tayga b/net/tayga/src/etc/rc.d/opnsense-tayga new file mode 100644 index 000000000..78ed736fc --- /dev/null +++ b/net/tayga/src/etc/rc.d/opnsense-tayga @@ -0,0 +1,35 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: opnsense-tayga +# REQUIRE: SERVERS +# KEYWORD: shutdown +# + +. /etc/rc.subr + +name=tayga + +stop_cmd=tayga_stop +rcvar=tayga_enable + +load_rc_config opnsense-tayga +pidfile=/var/run/${name}.pid +command=/usr/local/sbin/${name} +command_args="-p ${pidfile}" + +[ -z "$tayga_enable" ] && tayga_enable="NO" + +tayga_stop() +{ + if [ -n "$rc_pid" ]; then + echo "stopping tayga" + kill -2 ${rc_pid} + ifconfig nat64 destroy + else + echo "${name} is not running." + fi +} + +run_rc_command $1 diff --git a/net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/Api/GeneralController.php b/net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/Api/GeneralController.php new file mode 100644 index 000000000..974e3d339 --- /dev/null +++ b/net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/Api/GeneralController.php @@ -0,0 +1,37 @@ + + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +namespace OPNsense\Tayga\Api; + +use OPNsense\Base\ApiMutableModelControllerBase; + +class GeneralController extends ApiMutableModelControllerBase +{ + protected static $internalModelClass = '\OPNsense\Tayga\General'; + protected static $internalModelName = 'general'; +} diff --git a/net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/Api/ServiceController.php b/net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/Api/ServiceController.php new file mode 100644 index 000000000..4c82981ce --- /dev/null +++ b/net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/Api/ServiceController.php @@ -0,0 +1,39 @@ + + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +namespace OPNsense\Tayga\Api; + +use OPNsense\Base\ApiMutableServiceControllerBase; + +class ServiceController extends ApiMutableServiceControllerBase +{ + protected static $internalServiceClass = '\OPNsense\Tayga\General'; + protected static $internalServiceTemplate = 'OPNsense/Tayga'; + protected static $internalServiceEnabled = 'enabled'; + protected static $internalServiceName = 'tayga'; +} diff --git a/net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/GeneralController.php b/net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/GeneralController.php new file mode 100644 index 000000000..6cf94562b --- /dev/null +++ b/net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/GeneralController.php @@ -0,0 +1,38 @@ + + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +namespace OPNsense\Tayga; + +class GeneralController extends \OPNsense\Base\IndexController +{ + public function indexAction() + { + $this->view->generalForm = $this->getForm("general"); + $this->view->pick('OPNsense/Tayga/general'); + } +} diff --git a/net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/forms/general.xml b/net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/forms/general.xml new file mode 100644 index 000000000..e75b05a16 --- /dev/null +++ b/net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/forms/general.xml @@ -0,0 +1,32 @@ +
+ + general.enabled + + checkbox + This will activate Tayga. + + + general.v4address + + text + This is not your router's IPv4 address. Tayga requires its own address because it acts as an IPv4 and IPv6 router, and needs to be able to send ICMP messages. This address can safely be located inside the dynamic-pool prefix. + + + general.v6address + + text + This is not your routers IPv6 address. Tayga requires its own address because it acts as an IPv4 and IPv6 router, and needs to be able to send ICMP messages. Tayga will also respond to ICMP echo requests (ping6) at this address. You can leave it unspecified and Tayga will construct its IPv6 address using IPv4 address and the NAT64 prefix. + + + general.v6prefix + + text + This must be a prefix selected from your organizations IPv6 address space or the Well-Known Prefix 64:ff9b::/96. The IPv4 address space is mapped into the IPv6 address space by prepending this prefix to the IPv4 address. + + + general.v4pool + + text + Dynamic pool prefix. IPv6 hosts which send traffic through Tayga will be assigned an IPv4 address from the dynamic pool. + +
diff --git a/net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/ACL/ACL.xml b/net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/ACL/ACL.xml new file mode 100644 index 000000000..9e494c24f --- /dev/null +++ b/net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/ACL/ACL.xml @@ -0,0 +1,9 @@ + + + Services: Tayga configuration + + ui/tayga/* + api/tayga/* + + + diff --git a/net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/General.php b/net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/General.php new file mode 100644 index 000000000..f005f0cc2 --- /dev/null +++ b/net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/General.php @@ -0,0 +1,35 @@ + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ + +namespace OPNsense\Tayga; + +use OPNsense\Base\BaseModel; + +class General extends BaseModel +{ +} diff --git a/net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/General.xml b/net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/General.xml new file mode 100644 index 000000000..5f9ff3d26 --- /dev/null +++ b/net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/General.xml @@ -0,0 +1,27 @@ + + //OPNsense/tayga/general + Tayga configuration + 0.0.2 + + + 0 + Y + + + 192.168.255.1 + N + + + 2001:db8:1::2 + N + + + 2001:db8:1:ffff::/96 + N + + + 192.168.255.0/24 + N + + + diff --git a/net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/Menu/Menu.xml b/net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/Menu/Menu.xml new file mode 100644 index 000000000..aeee89cc1 --- /dev/null +++ b/net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/Menu/Menu.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/net/tayga/src/opnsense/mvc/app/views/OPNsense/Tayga/general.volt b/net/tayga/src/opnsense/mvc/app/views/OPNsense/Tayga/general.volt new file mode 100644 index 000000000..bded11ae6 --- /dev/null +++ b/net/tayga/src/opnsense/mvc/app/views/OPNsense/Tayga/general.volt @@ -0,0 +1,61 @@ +{# + +OPNsense® is Copyright © 2014 – 2020 by Deciso B.V. +This file is Copyright © 2020 by Michael Muenz +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +#} +
+ {{ partial("layout_partials/base_form",['fields':generalForm,'id':'frm_general_settings'])}} +
+
+ +
+
+ + diff --git a/net/tayga/src/opnsense/scripts/OPNsense/Tayga/setup.sh b/net/tayga/src/opnsense/scripts/OPNsense/Tayga/setup.sh new file mode 100644 index 000000000..e25a56081 --- /dev/null +++ b/net/tayga/src/opnsense/scripts/OPNsense/Tayga/setup.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +mkdir -p /var/db/tayga/ +chmod 644 /var/db/tayga +chown root:wheel /var/db/tayga diff --git a/net/tayga/src/opnsense/service/conf/actions.d/actions_tayga.conf b/net/tayga/src/opnsense/service/conf/actions.d/actions_tayga.conf new file mode 100644 index 000000000..5d4cf502a --- /dev/null +++ b/net/tayga/src/opnsense/service/conf/actions.d/actions_tayga.conf @@ -0,0 +1,23 @@ +[stop] +command:/usr/local/etc/rc.d/opnsense-tayga stop +parameters: +type:script_output +message:stopping tayga + +[start] +command:/usr/local/opnsense/scripts/OPNsense/Tayga/setup.sh; /usr/local/etc/rc.d/opnsense-tayga start +parameters: +type:script_output +message:starting tayga + +[restart] +command:/usr/local/etc/rc.d/opnsense-tayga stop; /usr/local/opnsense/scripts/OPNsense/Tayga/setup.sh; /usr/local/etc/rc.d/opnsense-tayga start +parameters: +type:script_output +message:restarting tayga + +[status] +command:/usr/local/etc/rc.d/opnsense-tayga status; exit 0 +parameters: +type:script_output +message:tayga status diff --git a/net/tayga/src/opnsense/service/templates/OPNsense/Tayga/+TARGETS b/net/tayga/src/opnsense/service/templates/OPNsense/Tayga/+TARGETS new file mode 100644 index 000000000..d990ee5d9 --- /dev/null +++ b/net/tayga/src/opnsense/service/templates/OPNsense/Tayga/+TARGETS @@ -0,0 +1,2 @@ +tayga:/etc/rc.conf.d/opnsense-tayga +tayga.conf:/usr/local/etc/tayga.conf diff --git a/net/tayga/src/opnsense/service/templates/OPNsense/Tayga/tayga b/net/tayga/src/opnsense/service/templates/OPNsense/Tayga/tayga new file mode 100644 index 000000000..45e40deac --- /dev/null +++ b/net/tayga/src/opnsense/service/templates/OPNsense/Tayga/tayga @@ -0,0 +1,6 @@ +{% if helpers.exists('OPNsense.tayga.general.enabled') and OPNsense.tayga.general.enabled == '1' %} +tayga_var_script="/usr/local/opnsense/scripts/OPNsense/Tayga/setup.sh" +tayga_enable="YES" +{% else %} +tayga_enable="NO" +{% endif %} diff --git a/net/tayga/src/opnsense/service/templates/OPNsense/Tayga/tayga.conf b/net/tayga/src/opnsense/service/templates/OPNsense/Tayga/tayga.conf new file mode 100644 index 000000000..ae027a407 --- /dev/null +++ b/net/tayga/src/opnsense/service/templates/OPNsense/Tayga/tayga.conf @@ -0,0 +1,11 @@ +{% if helpers.exists('OPNsense.tayga.general.enabled') and OPNsense.tayga.general.enabled == '1' %} + +tun-device nat64 +data-dir /var/db/tayga + +ipv4-addr {{ OPNsense.tayga.general.v4address }} +ipv6-addr {{ OPNsense.tayga.general.v6address }} +prefix {{ OPNsense.tayga.general.v6prefix }} +dynamic-pool {{ OPNsense.tayga.general.v4pool }} + +{% endif %}