AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 761526
Accepted
Ondra Sniper Flidr
Ondra Sniper Flidr
Asked: 2016-03-05 01:36:07 +0800 CST2016-03-05 01:36:07 +0800 CST 2016-03-05 01:36:07 +0800 CST

重定向到 iptables 中的另一个端口显示没有链错误

  • 772

我现在正面临 iptables 的奇怪问题。简单地说,我想将流量从端口 514 重定向到端口 5140。我正在使用这个 IPTables 命令来实现它:

iptables -t nat -A PREROUTING -p tcp --dport 514 -j REDIRECT --to-port 5140

但我仍然收到关于没有链条的错误

iptables: No chain/target/match by that name.

nat 表中肯定有 PREROUTING 链,这是 iptables -t nat -nL

root@VPS-LOGGER-TMP:~# iptables -t nat -nL
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    

我正在使用 Debian Wheezy 并且我已经加载了所有需要的模块:

root@VPS-LOGGER-TMP:~# lsmod |grep nat
iptable_nat            12928  0 
nf_nat                 18242  1 iptable_nat
nf_conntrack_ipv4      14078  4 nf_nat,iptable_nat
nf_conntrack           52720  4 xt_state,nf_conntrack_ipv4,nf_nat,iptable_nat
ip_tables              22042  2 iptable_filter,iptable_nat
x_tables               19118  9 ip_tables,iptable_filter,xt_multiport,ip6_tables,ip6table_filter,xt_state,xt_tcpudp,ipt_REJECT,iptable_nat

你能告诉我我做错了什么吗?据我所知,这应该可以完美地工作。非常感谢。

iptables
  • 1 1 个回答
  • 260 Views

1 个回答

  • Voted
  1. Best Answer
    BeerSerc
    2016-03-05T01:43:45+08:002016-03-05T01:43:45+08:00

    你需要

    CONFIG_IP_NF_TARGET_REDIRECT
    

    在内核配置中设置为 y 或 m 以便使用 -j REDIRECT。

    该模块将被称为 xt_REDIRECT,您的机器上似乎缺少该模块。

    • 0

相关问题

  • OpenVPN 的 Linux IP 转发 - 正确的防火墙设置?

  • iptables 单个规则中的多个源 IP

  • 存储 iptables 规则的规范方法是什么

  • 使用 iptables 和 dhcpd 进行端口转发

  • 根据 Apache 日志数据自动修改 iptables 以阻止行为不良的客户端

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve