Hotspot
The Hotspot capability built-in to LibreELEC works, but is rudimentary. It’s primary use case is to allow an operator to authenticate through hotel network portals and such upstream of the device. It’s designed to be as widely compatible as possible, with the trade off of limited performance, especially with multiple clients.
You can instead deploy hostapd. This is the most widely used linux authentication and wireless access point software.
What follows are my rough notes from cobbling things together. I may come back and do it again and clean things up.
The Cobbling
Download hostapd and libnl to the folder /storage/.kodi/userdata/scripts. This location was recommended so it would get backed up.
wget http://mirror.archlinuxarm.org/aarch64/extra/hostapd-2.10-4-aarch64.pkg.tar.xz
wget http://mirror.archlinuxarm.org/aarch64/core/libnl-3.9.0-1-aarch64.pkg.tar.xz
# Extract and copy to the scripts folder
- hostapd
- libnl-3.so.200
- libnl-genl-3.so.200
export LD_LIBRARY_PATH=/storage/bin:$LD_LIBRARY_PATH
export PATH=/storage/bin:$PATH
# You'll also need dnsmasq to hand out IPs.
wget http://mirror.archlinuxarm.org/aarch64/extra/dnsmasq-2.90-1-aarch64.pkg.tar.xz
wget http://mirror.archlinuxarm.org/aarch64/core/libnetfilter_conntrack-1.0.9-2-aarch64.pkg.tar.xz
wget http://mirror.archlinuxarm.org/aarch64/extra/nftables-1:1.0.9-3-aarch64.pkg.tar.xz
cp /storage/test/usr/lib/libnftables.so.1 .
wget http://mirror.archlinuxarm.org/aarch64/core/libnfnetlink-1.0.2-2-aarch64.pkg.tar.xz
cp /storage/test/usr/lib/libnfnetlink.so.0 .
wget http://mirror.archlinuxarm.org/aarch64/core/libnftnl-1.2.6-1-aarch64.pkg.tar.xz
cp /storage/test/usr/lib/libnftnl.so.11 /storage/bin/
wget http://mirror.archlinuxarm.org/aarch64/core/jansson-2.14-4-aarch64.pkg.tar.xz
cp /storage/test/usr/lib/libjansson.so.4 /storage/bin/
wget http://mirror.archlinuxarm.org/aarch64/core/readline-8.2.010-1-aarch64.pkg.tar.xz
cp /storage/test/usr/lib/libreadline.so.8 /storage/bin/
wget http://mirror.archlinuxarm.org/aarch64/core/ncurses-6.5-3-aarch64.pkg.tar.xz
You’ll need a service for all this.
vi /storage/.config/system.d/router.service
[Unit]
Description = Router
After=sys-subsystem-net-devices-wlan0.device
Wants=sys-subsystem-net-devices-wlan0.device
[Service]
Environment=LD_LIBRARY_PATH=/storage/bin
Type=forking
WorkingDirectory=/storage/bin
ExecStart=/storage/bin/ap-up
ExecStop=killall hostapd
ExecStop=killall dnsmasq
[Install]
WantedBy=default.target
with a the script in bin of
#!/bin/bash
ip link set wlan0 down
ip addr flush dev wlan0
ip link set wlan0 up
ip addr add 10.0.0.1/24 dev wlan0
sleep 2
cd /storage/bin
pgrep dnsmasq || /storage/bin/dnsmasq --conf-file=/storage/bin/dnsmasq.conf --dhcp-leasefile=/storage/bin/dnsmasq.leases
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT
sysctl -w net.ipv4.ip_forward=1
/storage/bin/hostapd -B /storage/bin/hostapd.conf
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.