【发布时间】:2014-08-12 04:06:34
【问题描述】:
iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 8080
当我尝试运行这个命令时,我遇到了错误:
iptables: No chain/target/match by that name
我的 iptables 版本是 v1.4.14。 在 linux 内核 3.8.11 上运行 debain。
iptables -L 输出:
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 输出:
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
我不知道问题出在哪里,我看了看,没有其他人在这个设置中遇到过这个错误。
【问题讨论】:
-
iptables -t nat -L的输出是什么? -
更改了 OP 以添加该输出。