Skip to content

Commit

Permalink
~修复mac过滤报错
Browse files Browse the repository at this point in the history
  • Loading branch information
juewuy committed Apr 13, 2024
1 parent 986c54f commit a4cab8f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ start_ipt_route() { #iptables-route通用工具
#局域网mac地址黑名单过滤
[ "$3" = 'PREROUTING' ] && [ -n "$(cat "$CRASHDIR"/configs/mac)" ] && [ "$macfilter_type" != "白名单" ] && {
for mac in $(cat "$CRASHDIR"/configs/mac); do
$1 -t $2 -A $4 -m mac --mac-. $mac -j RETURN
$1 -t $2 -A $4 -m mac --mac-source $mac -j RETURN
done
}
#tcp&udp分别进代理链
Expand All @@ -909,7 +909,7 @@ start_ipt_route() { #iptables-route通用工具
for mac in $( #mac白名单
cat "$CRASHDIR"/configs/mac
); do
$1 -t $2 -A $4 -p $5 -m mac --mac-. $mac -j $JUMP
$1 -t $2 -A $4 -p $5 -m mac --mac-source $mac -j $JUMP
done
else
for ip in $HOST_IP; do #仅限指定网段流量
Expand Down Expand Up @@ -944,13 +944,13 @@ start_ipt_dns() { #iptables-dns通用工具
#局域网mac地址黑名单过滤
[ "$2" = 'PREROUTING' ] && [ -s "$CRASHDIR"/configs/mac ] && [ "$macfilter_type" != "白名单" ] && {
for mac in $(cat "$CRASHDIR"/configs/mac); do
$1 -t nat -A $3 -m mac --mac-. $mac -j RETURN
$1 -t nat -A $3 -m mac --mac-source $mac -j RETURN
done
}
if [ "$2" = 'PREROUTING' ] && [ -s "$CRASHDIR"/configs/mac ] && [ "$macfilter_type" = "白名单" ]; then
for mac in $(cat "$CRASHDIR"/configs/mac); do
$1 -t nat -A $3 -p tcp -m mac --mac-. $mac -j REDIRECT --to-ports $dns_port
$1 -t nat -A $3 -p udp -m mac --mac-. $mac -j REDIRECT --to-ports $dns_port
$1 -t nat -A $3 -p tcp -m mac --mac-source $mac -j REDIRECT --to-ports $dns_port
$1 -t nat -A $3 -p udp -m mac --mac-source $mac -j REDIRECT --to-ports $dns_port
done
else
for ip in $HOST_IP; do #仅限指定网段流量
Expand Down

0 comments on commit a4cab8f

Please sign in to comment.