我正在寻找一种方法来阻止在csf小ip范围,例如151.80.31.103 to 151.80.31.115
我知道如何通过发出一个cm命令csf -d IP来阻塞每个ip,但是如给出的例子那样,有一种方法可以阻止一小部分ip范围。
我search了一段时间,但没有find任何相关的信息。
感谢任何提示!
如果您具有SSH访问权限,则可以使用vim或emacs或您最喜欢的文本编辑器手动编辑文件/etc/csf/csf.deny。
下面是该文件顶部的一部分,并提供了一些评论:
# The following IP addresses will be blocked in iptables # One IP address per line # CIDR addressing allowed with a quaded IP (eg 192.168.254.0/24) # Only list IP addresses, not domain names (they will be ignored) # # Note: If you add the text "do not delete" to the comments of an entry then # DENY_IP_LIMIT will ignore those entries and not remove them
给定信息,使用子网计算器(例如MXtoolbox中的这个子网)来确定较小的子网。 根据您的标准,mxtoolboxbuild议的一个可能子网将是151.80.31.96/27,它将过滤从151.80.31.96到151.80.31.127的所有内容。
确保你用csf -r重启CSF,然后用lfd -r重启lfd。