gedankensplitter/openwrt-selfbuild.md
2022-11-01 16:55:51 +01:00

9.1 KiB

openwrt build

base config

etc

blacklist.dns

127.0.0.1	lmlicenses.wip4.adobe.com
127.0.0.1	lm.licenses.adobe.com
127.0.0.1	na1r.services.adobe.com
127.0.0.1	hlrcv.stage.adobe.com
127.0.0.1	practivate.adobe.com 
127.0.0.1	activate.adobe.com

rc.local

#iw phy1 set distance auto
touch /var/run/mosquitto.pid
chown mosquitto:mosquitto /var/run/mosquitto.pid
service mosquitto start

/root/precache_dns.sh

/etc/config/luci

config command
	option name 'WPS sys@localhost'
	option command 'hostapd_cli -i wlan0 wps_pbc'

config command
	option name 'WPS sys@legacy'
	option command 'hostapd_cli -i wlan1 wps_pbc'

config command
	option name 'WPS @ IoT'
	option command 'hostapd_cli -i wlan1-1 wps_pbc'

config command
	option name 'WOL NAS1'
	option command '/usr/bin/etherwake -i br-lan A8:A1:59:51:38:10'

config command
	option name 'refreh dynvpn desec'
        option command 'curl -s -f --header "Authorization:Token 367e6bae0552cdfd133a9d222f56dcf9a79a0e99" https://update.dedyn.io/update?username=koelner.dedyn.io 2>&1 > /dev/null'

/etc/crontabs/root

#5 */1 * *  * curl -s -f -X PUT -u "waenger@googlemail.com:e04d4a9f56cbdd8d6da7fe91119807e7fbb85dba" -d '{"ip_address": "auto"}' https://api.twodns.de/hosts/koelner.dynvpn.de 2>&1 > /dev/null
5 */5 * *  * curl -s -f --header "Authorization:Token 367e6bae0552cdfd133a9d222f56dcf9a79a0e99" https://update.dedyn.io/update?username=koelner.dedyn.io 2>&1 > /dev/null
#
5 2 * *  * curl -s -f --header "Authorization:Token 367e6bae0552cdfd133a9d222f56dcf9a79a0e99" https://update.dedyn.io/update?username=geekable.dedyn.io 2>&1 > /dev/null
#5 */5 * *  * curl -s -f --header "Authorization:Token 367e6bae0552cdfd133a9d222f56dcf9a79a0e99" https://update6.dedyn.io/update?username=koelner.dedyn.io 2>&1 > /dev/null
#5 */1 * *  * curl -s -f --header "Authorization:Token 367e6bae0552cdfd133a9d222f56dcf9a79a0e99" https://update.dedyn.io/update?username=cloud.koelner.dedyn.io 2>&1 > /dev/null
#5 */1 * *  * curl -s -f --header "Authorization:Token 367e6bae0552cdfd133a9d222f56dcf9a79a0e99" https://update.dedyn.io/update?username=git.koelner.dedyn.io 2>&1 > /dev/null
#5 */1 * *  * curl -s -f  --header "Authorization:Token 367e6bae0552cdfd133a9d222f56dcf9a79a0e99" https://update.dedyn.io/update?username=sync.koelner.dedyn.io 2>&1 > /dev/null
#5 */1 * *  * curl -s -f --header "Authorization:Token 367e6bae0552cdfd133a9d222f56dcf9a79a0e99" https://update.dedyn.io/update?username=pyload.koelner.dedyn.io 2>&1 > /dev/null

/etc/mosquitto/mosquitto.conf

acl_file /etc/mosquitto/acl
password_file /etc/mosquitto/passwd
listener 1883
protocol mqtt
max_inflight_messages 20
max_queued_messages 100
allow_zero_length_clientid true
use_username_as_clientid false
pid_file /var/run/mosquitto.pid
sys_interval 60
user mosquitto

/usr/share/nlbwmon/protocols

6 22000 syncthing

root helper script

.profile

#!/bin/sh

opkgInstalled="$(opkg list-installed 2> /dev/null | wc -l)" #silencing error output
opkgUpgradable="$(opkg list-upgradable 2> /dev/null | wc -l)" #silencing error output

echo "$opkgInstalled packages are installed." && echo "$opkgUpgradable packages can be upgraded." && echo
echo "Upgrade commands:"
echo "List available updates: opkg list-upgradable"
echo "Upgrade package: upgrade <PACKAGE>"
echo "Upgrade all packages: opkg list-upgradable | cut -f 1 -d ' ' | xargs opkg upgrade" && echo

precache_dns.sh

/usr/bin/nslookup google.de 2>&1 >/dev/null &
/usr/bin/nslookup google.com 2>&1 >/dev/null &
/usr/bin/nslookup desec.io 2>&1 >/dev/null &
/usr/bin/nslookup twodns.de 2>&1 >/dev/null &
/usr/bin/nslookup update.dedyn.io 2>&1 >/dev/null &
/usr/bin/nslookup api.twodns.de 2>&1 >/dev/null &
/usr/bin/nslookup fernwartung.dynvpn.de 2>&1 >/dev/null &
/usr/bin/nslookup koelner.dynvpn.de 2>&1 >/dev/null &
/usr/bin/nslookup koelner.dedyn.io 2>&1 >/dev/null &
/usr/bin/nslookup mailbox.org 2>&1 >/dev/null &
/usr/bin/nslookup mail.google.com 2>&1 >/dev/null &
/usr/bin/nslookup github.com 2>&1 >/dev/null &
/usr/bin/nslookup gitlab.com 2>&1 >/dev/null &
/usr/bin/nslookup mozilla.org 2>&1 >/dev/null &
/usr/bin/nslookup startpage.com 2>&1 >/dev/null &

wifi-reboot.sh

#!/bin/sh

# list the interfaces names.
INTERFACES=$(iw dev | awk '$1=="Interface"{print $2}')

# list interfaces that does not have any clients connected.
for INTERFACE in $INTERFACES
do
  ASSOC_CLIENTS=`iw dev $INTERFACE station dump | awk '$1=="Station"' | grep -c "Station"`

  if [ "$ASSOC_CLIENTS" -lt 1 ]
  then
    RESTART_LIST="$RESTART_LIST $INTERFACE"
  fi
done

if [ ! -z $RESTART_LIST ]
then
  echo "$(date +"%F_%T"): restarting wifi - no clients or issues with $RESTART_LIST"
  wifi down
  sleep 1
  wifi up
fi

wol_nas1.sh

/usr/bin/etherwake -i br-lan A8:A1:59:51:38:10

package list

useful packages

wget-ssl
curl
wireguard-tools
fwknopd
fwknop
mosquitto-client-ssl
mosquitto-ssl
stubby

wpad-wolfssl
hostapd-utils
coreutils
coreutils-sort
addrwatch
htop
tmux
vim
zram-swap
luci
luci-ssl
luci-theme-bootstrap
luci-theme-material
luci-app-commands
luci-app-nlbwmon
luci-app-ntpc
luci-app-upnp
luci-app-wireguard
luci-app-wol
luci-app-fwknopd
luci-app-mosquitto
luci-proto-wireguard

blkid
block-mount
usbutils
usbids

kmod-nls-cp437
kmod-nls-cp850
kmod-nls-iso8859-1
kmod-nls-utf8
kmod-loop
kmod-fs-ext4
kmod-fs-vfat
kmod-fs-exfat
kmod-usb-serial
kmod-usb-serial-ch341
kmod-usb-serial-cp210x
kmod-usb-serial-ftdi
kmod-usb-serial-pl2303
kmod-usb-storage
kmod-usb-storage-uas
kmod-usb-gadget
kmod-usb-gadget-mass-storage
kmod-usb-gadget-serial

21.02

addrwatch
ath10k-board-qca988x
ath10k-firmware-qca988x
base-files
blkid
block-mount
blockd
busybox
cJSON
ca-bundle
ca-certificates
cgi-io
coreutils
coreutils-sort
curl
dnscrypt-proxy
dnscrypt-proxy-resolvers
dnsmasq-full
dropbear
etherwake
firewall
fstools
fwknop
fwknopd
fwtool
getdns
getrandom
glib2
hostapd-common
hostapd-utils
htop
igmpproxy
ip6tables
iptables
iptables-mod-conntrack-extra
iptables-mod-conntrack-label
iptables-mod-hashlimit
iptables-mod-iface
iptables-mod-ipopt
iptables-mod-iprange
iptables-mod-nfqueue
iw
iwinfo
jshn
jsonfilter
kernel
kmod-ath
kmod-ath10k
kmod-ath9k
kmod-ath9k-common
kmod-cfg80211
kmod-crypto-acompress
kmod-crypto-crc32c
kmod-crypto-hash
kmod-crypto-kpp
kmod-crypto-lib-blake2s
kmod-crypto-lib-chacha20
kmod-crypto-lib-chacha20poly1305
kmod-crypto-lib-curve25519
kmod-crypto-lib-poly1305
kmod-fs-autofs4
kmod-fs-configfs
kmod-fs-ext4
kmod-fs-msdos
kmod-fs-ntfs
kmod-fs-vfat
kmod-gpio-button-hotplug
kmod-hwmon-core
kmod-ifb
kmod-ip6tables
kmod-ipt-conntrack
kmod-ipt-conntrack-extra
kmod-ipt-conntrack-label
kmod-ipt-core
kmod-ipt-hashlimit
kmod-ipt-iface
kmod-ipt-ipopt
kmod-ipt-iprange
kmod-ipt-ipset
kmod-ipt-nat
kmod-ipt-nfqueue
kmod-ipt-offload
kmod-ipt-raw
kmod-lib-crc-ccitt
kmod-lib-crc16
kmod-lib-lzo
kmod-loop
kmod-mac80211
kmod-nf-conntrack
kmod-nf-conntrack-netlink
kmod-nf-conntrack6
kmod-nf-flow
kmod-nf-ipt
kmod-nf-ipt6
kmod-nf-nat
kmod-nf-reject
kmod-nf-reject6
kmod-nfnetlink
kmod-nfnetlink-queue
kmod-nls-base
kmod-nls-cp437
kmod-nls-cp850
kmod-nls-iso8859-1
kmod-nls-utf8
kmod-phy-ath79-usb
kmod-ppp
kmod-pppoe
kmod-pppox
kmod-random-core
kmod-sched-cake
kmod-sched-core
kmod-scsi-core
kmod-slhc
kmod-udptunnel4
kmod-udptunnel6
kmod-usb-core
kmod-usb-ehci
kmod-usb-gadget
kmod-usb-gadget-mass-storage
kmod-usb-gadget-serial
kmod-usb-ledtrig-usbport
kmod-usb-lib-composite
kmod-usb-serial
kmod-usb-serial-ch341
kmod-usb-serial-cp210x
kmod-usb-serial-ftdi
kmod-usb-serial-pl2303
kmod-usb-storage
kmod-usb-storage-uas
kmod-usb2
kmod-wireguard
kmod-zram
libattr
libblkid1
libblobmsg-json20210516
libc
libcap
libcap-ng
libcares
libcurl4
libdbi
libevdev
libevent2-7
libffi
libfko
libgcc1
libgmp10
libip4tc2
libip6tc2
libiwinfo-data
libiwinfo-lua
libiwinfo20210430
libjson-c5
libjson-script20210516
liblua5.1.5
liblucihttp-lua
liblucihttp0
libmnl0
libmosquitto-ssl
libncurses6
libnetfilter-conntrack3
libnetfilter-queue1
libnettle8
libnfnetlink0
libnghttp2-14
libnl-tiny1
libopenssl1.1
libpcap1
libpcre
libpthread
libqrencode
librt
libsodium
libubox20210516
libubus-lua
libubus20210630
libuci20130104
libuclient20201210
libudev-zero
libusb-1.0-0
libustream-wolfssl20201210
libuuid1
libwebsockets-openssl
libwolfssl5.2.0.99a5b54a
libxtables12
libyaml
logd
lua
luci
luci-app-commands
luci-app-dnscrypt-proxy
luci-app-firewall
luci-app-fwknopd
luci-app-mosquitto
luci-app-nlbwmon
luci-app-ntpc
luci-app-opkg
luci-app-sqm
luci-app-upnp
luci-app-wireguard
luci-app-wol
luci-base
luci-compat
luci-lib-base
luci-lib-httpprotoutils
luci-lib-ip
luci-lib-jsonc
luci-lib-nixio
luci-mod-admin-full
luci-mod-network
luci-mod-status
luci-mod-system
luci-proto-ipv6
luci-proto-ppp
luci-proto-wireguard
luci-ssl
luci-theme-bootstrap
luci-theme-material
miniupnpd
mosquitto-client-ssl
mosquitto-ssl
mtd
netifd
nlbwmon
ntpclient
odhcp6c
odhcpd-ipv6only
openwrt-keyring
opkg
ppp
ppp-mod-pppoe
procd
px5g-wolfssl
qrencode
rpcd
rpcd-mod-file
rpcd-mod-iwinfo
rpcd-mod-luci
rpcd-mod-rrdns
screen
sqm-scripts
sqm-scripts-extra
stubby
swconfig
tc-mod-iptables
tc-tiny
terminfo
tmux
uboot-envtools
ubox
ubus
ubusd
uci
uclient-fetch
uhttpd
uhttpd-mod-ubus
urandom-seed
urngd
usbids
usbutils
usign
vim
wget-ssl
wireguard-tools
wireless-regdb
wpa-cli
wpad-openssl
zlib
zram-swap