shell 过滤ip防火墙禁用

for ip in `cat dropip`

do
        if [[ $ip =~ "192.168" ]] || [[ $ip =~ "127" ]]; then
                echo "pass"
        else
                echo "$ip"
                iptables -I INPUT -p tcp -s $ip -j DROP
        fi
done
posted @ 2020-05-21 20:52  fang12311  阅读(2)  评论(0编辑  收藏  举报