linux禁止某个IP访问本机



linux禁止某个IP访问本机
 
#!/bin/bash
 
if [ $# -ne 1 ];then
        echo "usage : $0 ip "
        exit 0
fi  www.2cto.com  
DENY_IP="$1"
iptables -I INPUT -s $DENY_IP -j DROP
if [ $? -eq 0 ];then
        echo "$DENY_IP" >> deny_ip_list
fi
/etc/rc.d/init.d/iptables save
~                              
 

相关内容

    暂无相关文章