aboutsummaryrefslogtreecommitdiff
path: root/etc/local.d/03-miniupnpd.start
blob: a1a06560401229e76bfc791898bae2d8ea963270 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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