luci-app-accesscontrol: change to DNS filter method

This commit is contained in:
LEAN-ESX 2019-05-27 19:04:12 -07:00
parent 4ce1ffb2ae
commit 1c4e85af19
3 changed files with 12 additions and 8 deletions

View File

@ -11,7 +11,7 @@ LUCI_DEPENDS:=
LUCI_PKGARCH:=all
PKG_NAME:=luci-app-accesscontrol
PKG_VERSION:=1
PKG_RELEASE:=7
PKG_RELEASE:=9
include $(TOPDIR)/feeds/luci/luci.mk

View File

@ -6,7 +6,7 @@
# See /LICENSE for more information.
#
START=99
START=30
CONFIG=mia
@ -65,17 +65,21 @@ del_rule(){
}
start(){
stop
enable=$(uci get mia.@basic[0].enable)
[ $enable -eq 0 ] && exit 0
iptables -t filter -D FORWARD -m comment --comment "Rule For Control" -j MIA 2>/dev/null
iptables -t filter -F MIA 2>/dev/null
iptables -t filter -X MIA 2>/dev/null
iptables -t filter -N MIA
iptables -t filter -I FORWARD -m comment --comment "Rule For Control" -j MIA
iptables -I INPUT -p udp --dport 53 -m comment --comment "Rule For Control" -j MIA
iptables -I INPUT -p tcp --dport 53 -m comment --comment "Rule For Control" -j MIA
iptables -t nat -A PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 53 -m comment --comment "Rule For Control"
iptables -t nat -A PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports 53 -m comment --comment "Rule For Control"
add_rule
}
stop(){
iptables -t filter -D FORWARD -m comment --comment "Rule For Control" -j MIA 2>/dev/null
iptables -D INPUT -p udp --dport 53 -m comment --comment "Rule For Control" -j MIA 2>/dev/null
iptables -D INPUT -p tcp --dport 53 -m comment --comment "Rule For Control" -j MIA 2>/dev/null
iptables -t nat -D PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 53 -m comment --comment "Rule For Control" 2>/dev/null
iptables -t nat -D PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports 53 -m comment --comment "Rule For Control" 2>/dev/null
iptables -t filter -F MIA 2>/dev/null
iptables -t filter -X MIA 2>/dev/null
}

View File

@ -8,7 +8,7 @@ uci -q batch <<-EOF >/dev/null
delete firewall.mia
set firewall.mia=include
set firewall.mia.type=script
set firewall.mia.path=/var/etc/mia.include
set firewall.mia.path=/etc/mia.include
set firewall.mia.reload=1
commit firewall
EOF