小编mde*_*ous的帖子

在虚拟 IP 上发送的数据包不符合 iptables 规则

我有一个eth1:3带有 IP 地址的虚拟接口222.192.124.3,我已经设置了一个 iptables 规则来使用接口的 IP 记录来自该接口的数据包(我知道 iptables 不关心虚拟接口标签),如下所示:

iptables -A INPUT -d 222.192.124.3 -j LOG --log-level warning --log-prefix "VIP3-IN: "
Run Code Online (Sandbox Code Playgroud)

当我运行 tcpdump 并从另一台机器在这个 IP 上发送数据包时,我看到了它们,所以我假设它们被内核正确接收和处理,但是 iptables 从不记录这些数据包,当我运行时iptables -nvL,该规则的数据包计数是'不增加,就像他们从未达到规则一样(或者就像 iptables 甚至没有看到该接口上的数据包)。

我首先想到了另一个匹配数据包的规则,从而在它遇到 LOG 规则之前处理它,所以我删除了每个 iptables 规则,只添加了日志记录规则,但没有成功。

服务器在 RHEL 6.2 上运行,具有 2.6.32 内核,在 VMware ESX 上虚拟化。

这是完整的输出iptables -nvL

Chain INPUT (policy ACCEPT 40 packets, 2891 bytes)
  pkts bytes target     prot opt in     out     source               destination
  0     0    LOG        all  --  *      *       0.0.0.0/0 …
Run Code Online (Sandbox Code Playgroud)

networking linux iptables rhel6

7
推荐指数
1
解决办法
5506
查看次数

标签 统计

iptables ×1

linux ×1

networking ×1

rhel6 ×1