aboutsummaryrefslogtreecommitdiff
path: root/etc/local.d/03-miniupnpd.start
diff options
context:
space:
mode:
Diffstat (limited to 'etc/local.d/03-miniupnpd.start')
-rwxr-xr-xetc/local.d/03-miniupnpd.start33
1 files changed, 33 insertions, 0 deletions
diff --git a/etc/local.d/03-miniupnpd.start b/etc/local.d/03-miniupnpd.start
new file mode 100755
index 0000000..a1a0656
--- /dev/null
+++ b/etc/local.d/03-miniupnpd.start
@@ -0,0 +1,33 @@
+#!/bin/sh
+. /etc/local.d/vars.sh
+conf="/etc/miniupnpd/miniupnpd.conf"
+lease_file=/var/lib/misc/upnp.leases
+
+cat > "$conf" <<EOF
+ext_ifname=$wan
+listening_ip=$lan
+# ext_ip=
+# ext_stun_host=stun.stunprotocol.org
+# ext_perform_stun=yes
+model_number=$(uname -r | grep -oE '[0-9.]+' | sed 1q)
+serial=12345678
+enable_natpmp=yes
+enable_upnp=yes
+lease_file=$lease_file
+# Secure Mode, UPnP clients can only add mappings to their own IP
+secure_mode=yes
+presentation_url=http://$lan_ip
+clean_ruleset_interval=600
+min_lifetime=120
+max_lifetime=86400
+# UUID, generate your own UUID with "make genuuid"
+uuid=$(uuidgen)
+# allow 1024-65535 $lan_net/$lan_mask_bits 1024-65535
+# deny 0-65535 0.0.0.0/0 0-65535
+EOF
+
+echo "Generating miniupnpd conf:"
+
+cat "$conf"
+
+. /etc/local.d/vars_end.sh