mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-07-25 00:38:10 -07:00
Improved support for subnet colisions, and attempts to rejoin network.
This commit is contained in:
Vendored
+4
-1
@@ -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
|
||||
|
||||
+21
@@ -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
|
||||
Reference in New Issue
Block a user