Improved support for subnet colisions, and attempts to rejoin network.

This commit is contained in:
Ember
2026-03-03 14:32:28 -08:00
parent 120b6c887e
commit 8ab2bd0e5c
8 changed files with 650 additions and 117 deletions
+4 -1
View File
@@ -6,8 +6,11 @@ case "$1" in
iptables -A OUTPUT -o lo -j ACCEPT
iptables -A OUTPUT -o bridge0 -j ACCEPT
iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -p udp --dport 67:68 -j ACCEPT
iptables -A OUTPUT -p udp --dport 53 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 53 -j ACCEPT
iptables -A OUTPUT -j DROP
echo 0 > /proc/sys/net/bridge/bridge-nf-call-iptables
echo 0 > /proc/sys/net/bridge/bridge-nf-call-iptables 2>/dev/null
fi
;;
esac
Vendored Executable
+21
View File
@@ -0,0 +1,21 @@
#!/bin/sh
# udhcpc hook script for rayhunter WiFi client mode.
# Saves DHCP lease info (gateway, DNS) so the daemon can read the real
# gateway even when subnets collide. Routing is handled by the daemon.
#
# Deployed to /data/rayhunter/udhcpc-hook.sh by the installer.
# Any installer that adds wifi-client support must also deploy this script.
LEASE_FILE="/data/rayhunter/dhcp_lease"
case "$1" in
bound|renew)
ip addr flush dev "$interface"
ip addr add "$ip/$mask" dev "$interface"
echo "gateway=$router" > "$LEASE_FILE"
echo "dns=$dns" >> "$LEASE_FILE"
;;
deconfig)
ip addr flush dev "$interface"
rm -f "$LEASE_FILE"
;;
esac