大网数据广告活动
服务器运维问答

csf: how to override TCP_IN?

· 52CE 我爱测

I'm using csf v14.05 on my Debian-8-based server. In csf.conf , I have the following: TCP_IN = "53,80,110,119,143,443,465,587,953,993,995" I want to selectively override this in csf.deny , only for certain specific host/port comb…

问题原文

原帖链接 · HippoMan · CC BY-SA 4.0

I'm using csf v14.05 on my Debian-8-based server.

In csf.conf, I have the following:

TCP_IN = "53,80,110,119,143,443,465,587,953,993,995"

I want to selectively override this in csf.deny, only for certain specific host/port combinations, as in the following example:

tcp|in|d=143|s=aaa.bbb.ccc.ddd # actual IP address dummied out

However, requests coming from aaa.bbb.ccc.ddd to port 443 are still being allowed.

I know that csf.allow rules override all other rules, and therefore, it appears that TCP_IN within csf.conf also behaves the same way.

Is there any way in csf to allow open access to a given port except for certain, selected IP addresses, like I am trying to do here?

Thank you very much.

已采纳解答

原帖链接 · Chux Uzoeto · CC BY-SA 4.0

This is a source of common confusion ...

TCP_IN allows all the ports listed, regardless of csf.allow (except the csf.allow rule is a deny rule)

So, if you really wanted to selectively allow access to a port, you would exclude it from TCP_IN of csf.conf ... and then have it in csf.allow

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-10-05)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。