如何用 iptables 禁止某个ip?

1、添加对 114.32.207.47 的过滤(直接 DROP 掉)

iptables -I INPUT -s 114.32.207.47 -j DROP

 

2、检查设置是否正常

iptables --list

Chain INPUT (policy ACCEPT)

target     prot opt source               destination         

DROP       all  --  114-32-207-47.HINET-IP.hinet.net  anywhere            



Chain FORWARD (policy ACCEPT)

target     prot opt source               destination         



Chain OUTPUT (policy ACCEPT)

target     prot opt source               destination     

  

你可能感兴趣的:(iptables)