本文介绍了IPTABLES错误“ iptables:该名称没有链/目标/匹配”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 8080

当我尝试运行此命令时,遇到了以下错误:

When I try to run this command, I run into the error:

iptables: No chain/target/match by that name

我的iptables版本是v1。 4.14。
在Linux内核3.8.11上运行debain。

My iptables version is v1.4.14.Running debain on linux kernel 3.8.11.

iptables -L输出:

iptables -L outputs:

Chain INPUT (policy DROP)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
ACCEPT     all  --  anywhere             anywhere
ACCEPT     icmp --  anywhere             anywhere
ACCEPT     udp  --  anywhere             224.0.0.251          udp dpt:mdns
NFQUEUE    udp  --  anywhere             anywhere             NFQUEUE num 10000

Chain FORWARD (policy DROP)
target     prot opt source               destination

Chain OUTPUT (policy DROP)
target     prot opt source               destination
NFQUEUE    udp  --  anywhere             239.255.255.250      udp dpt:1900 NFQUEUE num 10001
ACCEPT     all  --  anywhere             anywhere             ctstate NEW,RELATED,ESTABLISHED
ACCEPT     all  --  anywhere             anywhere

iptables -t nat -L输出:

iptables -t nat -L output:

Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination

Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination

我不知道问题出在什么地方,我看着,没有其他人知道

I have no clue what the problem is, and I looked and nobody else has had this error with this setup.

推荐答案

该错误表示您缺少内核中的iptables REDIRECT模块。

The error means that you are missing the iptables REDIRECT module in the kernel.

也许您自己编译了内核?然后您需要启用/设置选项

Perhaps you compiled the kernel yourself? Then you need to enable/set the option

CONFIG_IP_NF_TARGET_REDIRECT=m

在您的内核配置中,然后

in your kernel config and then

make modules
make modules_install
depmod -ae

这篇关于IPTABLES错误“ iptables:该名称没有链/目标/匹配”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-08 09:13