我今年两次遭到中国防火墙的DDos攻击。
现在,我从http://www.ipdeny.com/ipblocks/下载区域文件。我想执行以下操作:
我能怎么做?
我使用Cloudflare CDN免费计划,但是我只想在服务器上做上述事情。
如果您正在使用iptables
,它将根据第一个匹配规则返回。例如,如果要允许使用http并拒绝中国的其他端口,请确保首先使用http允许规则:
iptables -A INPUT -d myhost --dport 80 -j ACCEPT
iptables -A INPUT -m set --match-set china src -j DROP
使用以上语句,您将需要ipset
使用以下方法为中国创建一个:
ipset create china hash:net
while read line; do ipset add china $line; done < china.ipblock-file
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句