aboutsummaryrefslogtreecommitdiff
path: root/net/jool/files
diff options
context:
space:
mode:
authorTiago Gaspar <tiagogaspar8@gmail.com>2022-01-10 13:42:12 +0000
committerRosen Penev <rosenp@gmail.com>2022-01-12 04:00:30 -0800
commit98ac608fb86f802d46ba7ba4c899125b071cd282 (patch)
tree478fad3f32093641d03ba380c6ce9c6724933216 /net/jool/files
parent72974bed43d5af0ea17769f33ce6a3824cc858ec (diff)
jool: update to 4.1.6, add init files and default configuration
This commit adds support for starting and running jool through init scripts, with default config files as examples. Signed-off-by: Tiago Gaspar <tiagogaspar8@gmail.com>
Diffstat (limited to 'net/jool/files')
-rw-r--r--net/jool/files/jool-nat64.conf.json75
-rw-r--r--net/jool/files/jool-siit.conf.json48
-rw-r--r--net/jool/files/jool.config8
-rw-r--r--net/jool/files/jool.init57
-rw-r--r--net/jool/files/readme.md28
5 files changed, 216 insertions, 0 deletions
diff --git a/net/jool/files/jool-nat64.conf.json b/net/jool/files/jool-nat64.conf.json
new file mode 100644
index 000000000..65eda0ea6
--- /dev/null
+++ b/net/jool/files/jool-nat64.conf.json
@@ -0,0 +1,75 @@
+{
+ "comment": "Sample full NAT64 configuration.",
+ "comment": "Configuration details at https://jool.mx/en/usr-flags-global.html",
+
+ "instance": "default",
+ "framework": "netfilter",
+
+ "global": {
+ "pool6": "64:ff9b::/96",
+
+ "manually-enabled": false,
+
+ "zeroize-traffic-class": false,
+ "override-tos": false,
+ "tos": 0,
+ "mtu-plateaus": [65535, 32000, 17914, 8166, 4352, 2002, 1492, 1006, 508, 296, 68],
+ "maximum-simultaneous-opens": 10,
+ "source-icmpv6-errors-better": true,
+ "handle-rst-during-fin-rcv": false,
+ "f-args": 11,
+
+ "logging-bib": false,
+ "logging-session": false,
+
+ "address-dependent-filtering": false,
+ "drop-icmpv6-info": false,
+ "drop-externally-initiated-tcp": false,
+
+ "udp-timeout": "5:00",
+ "tcp-est-timeout": "2:00:00",
+ "tcp-trans-timeout": "4:00",
+ "icmp-timeout": "1:00",
+
+ "ss-enabled": false,
+ "ss-flush-asap": true,
+ "ss-flush-deadline": 2000,
+ "ss-capacity": 512,
+ "ss-max-payload": 1452
+ },
+
+ "pool4": [
+ {
+ "mark": 1,
+ "protocol": "UDP",
+ "prefix": "192.0.2.1",
+ "port range": "61001-62000",
+ "max-iterations": 1500
+ }, {
+ "comment": "mark, port range and max-iterations are optional.",
+ "protocol": "TCP",
+ "prefix": "192.0.2.2/31"
+ }, {
+ "mark": 1,
+ "protocol": "ICMP",
+ "prefix": "192.0.2.1/32",
+ "port range": "1000-2000"
+ }
+ ],
+
+ "bib": [
+ {
+ "protocol": "TCP",
+ "ipv6 address": "2001:db8::1#80",
+ "ipv4 address": "192.0.2.2#80"
+ }, {
+ "protocol": "UDP",
+ "ipv6 address": "2001:db8::2#10000",
+ "ipv4 address": "192.0.2.1#61500"
+ }, {
+ "protocol": "ICMP",
+ "ipv6 address": "2001:db8:AAAA::1#44",
+ "ipv4 address": "192.0.2.1#1044"
+ }
+ ]
+}
diff --git a/net/jool/files/jool-siit.conf.json b/net/jool/files/jool-siit.conf.json
new file mode 100644
index 000000000..3add3aebf
--- /dev/null
+++ b/net/jool/files/jool-siit.conf.json
@@ -0,0 +1,48 @@
+{
+ "comment": "Sample full SIIT configuration.",
+ "comment": "Configuration details at https://jool.mx/en/usr-flags-global.html",
+
+ "instance": "instance name",
+ "framework": "netfilter",
+
+ "global": {
+ "comment": "pool6 and the RFC6791v4 pool belong here, ever since Jool 4.",
+ "pool6": "64:ff9b::/96",
+ "manually-enabled": true,
+ "zeroize-traffic-class": false,
+ "override-tos": false,
+ "tos": 0,
+ "mtu-plateaus": [65535, 32000, 17914, 8166, 4352, 2002, 1492, 1006, 508, 296, 68],
+ "amend-udp-checksum-zero": false,
+ "eam-hairpin-mode": "intrinsic",
+ "randomize-rfc6791-addresses": true,
+ "rfc6791v6-prefix": null,
+ "rfc6791v4-prefix": null
+ },
+
+ "eamt": [
+ {
+ "comment": {
+ "text": "Here's a compound comment.",
+ "more": "Its type is not checked, after all.",
+ "date": "2019-01-06",
+ "whatever": 1234
+ },
+ "ipv6 prefix": "2001:db8:1::/128",
+ "ipv4 prefix": "192.0.2.0"
+ }, {
+ "ipv6 prefix": "2001:db8:2::",
+ "ipv4 prefix": "192.0.2.1/32"
+ }, {
+ "ipv6 prefix": "2001:db8:3::/124",
+ "ipv4 prefix": "192.0.2.16/28"
+ }
+ ],
+
+ "comment": "This comment is relevant to blacklist4 maybe.",
+ "blacklist4": [
+ "198.51.100.0",
+ "198.51.100.2/32",
+ "198.51.100.32/27"
+ ]
+}
diff --git a/net/jool/files/jool.config b/net/jool/files/jool.config
new file mode 100644
index 000000000..ed3e866cc
--- /dev/null
+++ b/net/jool/files/jool.config
@@ -0,0 +1,8 @@
+config jool 'general'
+ option enabled '0'
+
+config jool 'nat64'
+ option enabled '0'
+
+config jool 'siit'
+ option enabled '0'
diff --git a/net/jool/files/jool.init b/net/jool/files/jool.init
new file mode 100644
index 000000000..e02af4784
--- /dev/null
+++ b/net/jool/files/jool.init
@@ -0,0 +1,57 @@
+#!/bin/sh /etc/rc.common
+
+START=54
+STOP=54
+
+PROG_NAT64="/usr/bin/jool"
+PROG_SIIT="/usr/bin/jool_siit"
+
+CONFIGFILE_NAT64="/etc/jool/jool-nat64.conf.json"
+CONFIGFILE_SIIT="/etc/jool/jool-siit.conf.json"
+
+config_parser(){
+ enabled=0
+ enabled_nat64=0
+ enabled_siit=0
+
+ config_load "jool"
+
+ #verify if the services are enabled in the configuration and populate it's variables
+ config_get_bool enabled general enabled 0
+ config_get_bool enabled_nat64 nat64 enabled 0
+ config_get_bool enabled_siit siit enabled 0
+
+ #If the main service is not enabled exit
+ [ "$enabled" -eq 0 ] && return 1
+
+ #if nat64 is enabled continue
+ if [ "$enabled_nat64" -gt 0 ]; then
+ #check if the orer is to start or stop
+ if [ "$1" -gt 0 ]; then
+ #start jool
+ $PROG_NAT64 file handle $CONFIGFILE_NAT64
+ else
+ $PROG_NAT64 -f $CONFIGFILE_NAT64 instance remove
+ fi
+ fi
+
+ #if siit is enabled continue
+ if [ "$enabled_siit" -gt 0 ]; then
+ #check if the orer is to start or stop
+ if [ "$1" -gt 0 ]; then
+ #start jool
+ $PROG_SIIT file handle $CONFIGFILE_SIIT
+ else
+ $PROG_SIIT -f $CONFIGFILE_SIIT instance remove
+ fi
+ fi
+}
+
+start() {
+ config_parser 1
+}
+
+stop() {
+ config_parser 0
+
+}
diff --git a/net/jool/files/readme.md b/net/jool/files/readme.md
new file mode 100644
index 000000000..88f978d9d
--- /dev/null
+++ b/net/jool/files/readme.md
@@ -0,0 +1,28 @@
+# [Jool](https://www.jool.mx)
+
+## Documentation
+
+[See here](https://www.jool.mx/en/documentation.html).
+
+You might also want to see [contact info](https://www.jool.mx/en/contact.html).
+
+## Usage
+
+### Start script
+
+This package includes a start script that will:
+ 1. Read the configuration file `/etc/config/jool`
+ 2. Determine what services are active
+ 3. Run jool with procd
+
+For now this means that:
+ * The services will be disabled by default in the uci config `(/etc/config/jool)`
+ * The only uci configuration support available for the package is to enable or disable each instance or the entire deamon
+ * There is no uci support and configuration will be saved at `/etc/jool/*
+ * Only one instance of jool(nat64) can run with the boot script
+ * Only one instance of jool(siit) can run with the boot script
+ * For now there is no way of overriding of the configuration file's paths
+
+The configuration files the startup script useses for each jool instance are:
+ * jool(nat64): `/etc/jool/jool-nat64.conf.json`
+ * jool(siit): `/etc/jool/jool-siit.conf.json`