mirror of https://github.com/bol-van/zapret/
8 changed files with 59 additions and 15 deletions
@ -0,0 +1,18 @@ |
|||
TPPORT=1188 |
|||
TPWS_USER=daemon |
|||
|
|||
. /lib/functions/network.sh |
|||
|
|||
network_find_wan wan_iface |
|||
|
|||
for ext_iface in $wan_iface; do |
|||
network_get_device DEVICE $ext_iface |
|||
# DNAT for local traffic |
|||
iptables -t nat -C OUTPUT -p tcp --dport 80 -o $DEVICE -m owner ! --uid-owner $TPWS_USER -m set --match-set zapret dst -j DNAT --to 127.0.0.1:$TPPORT || |
|||
iptables -t nat -I OUTPUT -p tcp --dport 80 -o $DEVICE -m owner ! --uid-owner $TPWS_USER -m set --match-set zapret dst -j DNAT --to 127.0.0.1:$TPPORT |
|||
|
|||
done |
|||
|
|||
sysctl -w net.ipv4.conf.br-lan.route_localnet=1 |
|||
iptables -t nat -C prerouting_lan_rule -p tcp --dport 80 -m set --match-set zapret dst -j DNAT --to 127.0.0.1:$TPPORT || |
|||
iptables -t nat -I prerouting_lan_rule -p tcp --dport 80 -m set --match-set zapret dst -j DNAT --to 127.0.0.1:$TPPORT |
@ -1,5 +1,2 @@ |
|||
# put it to /etc/firewall.user |
|||
|
|||
# for MNS ISP |
|||
iptables -t raw -C PREROUTING -p tcp --sport 80 --tcp-flags SYN,ACK SYN,ACK -m set --match-set zapret src -j NFQUEUE --queue-num 200 --queue-bypass || |
|||
iptables -t raw -I PREROUTING -p tcp --sport 80 --tcp-flags SYN,ACK SYN,ACK -m set --match-set zapret src -j NFQUEUE --queue-num 200 --queue-bypass |
|||
|
@ -1,5 +1,2 @@ |
|||
# put it to /etc/firewall.user |
|||
|
|||
# for Rostelecom ISP |
|||
iptables -t raw -C PREROUTING -p tcp --sport 80 --tcp-flags SYN,ACK SYN,ACK -m set --match-set zapret src -j NFQUEUE --queue-num 200 --queue-bypass || |
|||
iptables -t raw -I PREROUTING -p tcp --sport 80 --tcp-flags SYN,ACK SYN,ACK -m set --match-set zapret src -j NFQUEUE --queue-num 200 --queue-bypass |
|||
|
Loading…
Reference in new issue