我试图在iptabes中按进程名称匹配数据包。 我正在尝试用ping和我得到的一个例子: https : //www.frozentux.net/iptables-tutorial/iptables-tutorial.html#OWNERMATCH
我input的命令是:
iptables -N mychain iptables -A OUTPUT -m owner --cmd -owner ping -j mychain
但是,我得到:
iptables v1.4.21: unknown option "--cmd-owner" Try 'iptables -h' or 'iptables --help' for more information.
当我这样做时,我看不到“–cmd-owner”选项。 这是因为这个选项不再可用在iptables v1.4.21吗? 任何人都可以告诉我,如果这个选项不再可用我怎么可以在我的主机上的每个进程math数据包?
显然这是从iptables在某个时候删除…我无法弄清楚什么时候。 我没有find这个Ubuntu的错误报告。
https://bugs.launchpad.net/ubuntu/+source/iptables/+bug/800781
没有提到它被从git中删除,但有一个引用,当它最初被添加。
https://git.netfilter.org/iptables/log/?qt=grep&q=cmd-owner
最后在这里find它: http : //www.spinics.net/lists/netfilter/msg49716.html
commit 34b4a4a624bafe089107966a6c56d2a1aca026d4 Author: Christoph Hellwig <hch@xxxxxx> Date: Sun Aug 14 17:33:59 2005 -0700 [NETFILTER]: Remove tasklist_lock abuse in ipt{,6}owner Rip out cmd/sid/pid matching since its unfixable broken and stands in the way of locking changes to tasklist_lock. Signed-off-by: Christoph Hellwig <hch@xxxxxx> Signed-off-by: Patrick McHardy <kaber@xxxxxxxxx> Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx> It's a little late to come with "I need this" 5 years after the fact. >Is there any alternative for this? I mean to set up a static rule that >assigns specific command-line netfilter acls? SELinux, SNET, or other LSMs.
对不起,如果这听起来不是很有帮助。 这是我能做的最好的。 我不太了解iptables的东西。