0937
This commit is contained in:
33
files/stopblock.sh
Normal file
33
files/stopblock.sh
Normal file
@@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
LAN_IF="br-lan"
|
||||
LAN_NET="192.168.2.0/24"
|
||||
|
||||
# -------------------------
|
||||
# FILTER: remove CAPTIVE_BLOCK hook + chain
|
||||
# -------------------------
|
||||
|
||||
# Remove any FORWARD jumps that match our hook exactly
|
||||
while iptables -C FORWARD -i "$LAN_IF" -s "$LAN_NET" -j CAPTIVE_BLOCK 2>/dev/null; do
|
||||
iptables -D FORWARD -i "$LAN_IF" -s "$LAN_NET" -j CAPTIVE_BLOCK
|
||||
done
|
||||
|
||||
# Flush/delete CAPTIVE_BLOCK chain if present
|
||||
iptables -F CAPTIVE_BLOCK 2>/dev/null || true
|
||||
iptables -X CAPTIVE_BLOCK 2>/dev/null || true
|
||||
|
||||
# -------------------------
|
||||
# NAT: remove CAPTIVE hook + chain
|
||||
# -------------------------
|
||||
|
||||
# Remove any PREROUTING jumps that match our hook exactly
|
||||
while iptables -t nat -C PREROUTING -i "$LAN_IF" -s "$LAN_NET" -j CAPTIVE 2>/dev/null; do
|
||||
iptables -t nat -D PREROUTING -i "$LAN_IF" -s "$LAN_NET" -j CAPTIVE
|
||||
done
|
||||
|
||||
# Flush/delete CAPTIVE chain if present
|
||||
iptables -t nat -F CAPTIVE 2>/dev/null || true
|
||||
iptables -t nat -X CAPTIVE 2>/dev/null || true
|
||||
|
||||
echo "OK: captive NAT + filter rules removed (baseline preserved)."
|
||||
Reference in New Issue
Block a user