Kaspersky Endpoint Security 12 for Linux

在命令行中配置网络数据包规则列表

2024年8月2日

ID 197290

要添加网络数据包规则,请执行以下命令:

kesl-control --add-rule [--name <规则名称>] [--action <操作>] [--protocol <协议>] [--direction <方向>] [--remote <远程地址>[:<端口范围>]] [--local <本地地址>[:<端口范围>]] [--at <索引>]

其中:

  • --name <规则名称> 是网络数据包规则的名称。
  • --action <操作> 是对网络数据包规则中指定的连接执行的操作。
  • --protocol <协议> 是要监控其网络活动的数据传输协议的类型。
  • --direction <方向> 是被监控的网络活动的方向。
  • --remote <远程地址[:<端口范围>]>是远程设备的网络地址。您可以将预定义网络区域的名称指定作为远程地址。
  • --local <本地地址[:<端口范围>]> 是已安装 Kaspersky Endpoint Security 的设备的网络地址。
  • --at <索引> 是网络数据包规则列表中的规则索引。如果未指定 --at 键或其值大于列表中的规则数,则新规则会被添加到列表末尾。

命令中未指定值的参数被设置为其默认值

例如:

要创建规则阻止到 TCP 端口 23 的所有传入和已建立的连接,请执行以下命令:

kesl-control --add-rule --name Block_Telnet --action Block --direction in --protocol TCP --local any:23 --remote any

要为公共网络区域创建规则以阻止通过 TCP 端口 23 的传入和已建立的连接,请执行以下命令:

kesl-control --add-rule --name Block_Telnet --action Block --direction in --protocol TCP --local any:23 --remote Public

要删除网络数据包规则,请执行以下命令之一:

  • kesl-control --del-rule --name <规则名称>
  • kesl-control --del-rule --index <索引>

其中:

  • --name <规则名称>是网络数据包规则的名称。
  • --index <索引> 是网络数据包规则列表中的当前规则索引。

如果网络数据包规则列表包含多个名称相同的规则或者不包含具有指定名称或索引的规则,则会发生错误。

如要更改网络数据包规则的执行优先级,请执行以下命令之一:

  • kesl-control --move-rule --name <规则名称> --at <索引>
  • kesl-control --move-rule --index <索引> --at <索引>

其中:

  • --name <规则名称>是网络数据包规则的名称。
  • --index <索引> 是网络数据包规则列表中的当前规则索引。
  • --at <索引> 是网络数据包规则列表中的新规则索引。

您觉得这篇文章有帮助吗?
我们可以做什么更好?
感谢您的反馈!你正在帮助我们进步。
感谢您的反馈!你正在帮助我们进步。