mirror of
https://github.com/bol-van/zapret.git
synced 2025-05-24 22:32:58 +03:00
ipv6 support
This commit is contained in:
@@ -1,21 +1,5 @@
|
||||
TPPORT_HTTP=1188
|
||||
TPWS_USER=daemon
|
||||
IPT_FILTER_HTTP="-p tcp --dport 80 -m set --match-set zapret dst"
|
||||
|
||||
ipt()
|
||||
{
|
||||
iptables -C $@ 2>/dev/null || iptables -I $@
|
||||
}
|
||||
. /opt/zapret/init.d/openwrt/functions
|
||||
|
||||
. /lib/functions/network.sh
|
||||
network_find_wan wan_iface
|
||||
|
||||
for ext_iface in $wan_iface; do
|
||||
network_get_device DEVICE $ext_iface
|
||||
|
||||
ipt OUTPUT -t nat -o $DEVICE -m owner ! --uid-owner $TPWS_USER $IPT_FILTER_HTTP -j DNAT --to 127.0.0.1:$TPPORT_HTTP
|
||||
done
|
||||
|
||||
network_get_device DEVICE lan
|
||||
sysctl -w net.ipv4.conf.$DEVICE.route_localnet=1
|
||||
ipt prerouting_lan_rule -t nat $IPT_FILTER_HTTP -j DNAT --to 127.0.0.1:$TPPORT_HTTP
|
||||
fw_tpws
|
||||
|
Reference in New Issue
Block a user