重定向 ip6tables 中的端口

2024-01-29

如何使用 ip6tables 将一个端口重定向到另一个本地端口? 例如像这样的东西: ip6tables -t nat -A 预路由 -j 重定向 -p tcp --dport 443 --to-ports 8443


嗯,这是一个老问题,但因为我需要做同样的事情......这是我发现的:

TPROXY

This target is only valid in the mangle table, in the PREROUTING chain and user-defined chains which are only called from this chain. It redirects the packet to a local socket without changing the packet header in any way. It can also change the mark value which can then be used in advanced routing rules. It takes three options:
--on-port port
    This specifies a destination port to use. It is a required option, 0 means the new destination port is the same as the original. This is only valid if the rule also specifies -p tcp or -p udp. 
--on-ip address
    This specifies a destination address to use. By default the address is the IP address of the incoming interface. This is only valid if the rule also specifies -p tcp or -p udp. 
--tproxy-mark value[/mask]
    Marks packets with the given value/mask. The fwmark value set here can be used by advanced routing. (Required for transparent proxying to work: otherwise these packets will get forwarded, which is probably not what you want.)

当然,这仅对 ip6tables 有效。所以我想这是有效的:

ip6tables -t mangle -A PREROUTING -p tcp --dport 443 -j TPROXY --on-port 8443

不过,我还没有尝试过。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

重定向 ip6tables 中的端口 的相关文章

  • Apple 应用商店 IPV6 要求

    我打算在 Apple Store 上发布一个应用程序 然后我知道了 IPV6 拒绝问题 我的应用程序仅支持 IPV4 并且在此link我发现该应用程序应该支持 IPV6 所以我的问题是 应用程序是否必须同时支持 IPV4 和 IPV6 抱歉
  • Windows 不会从所有接口接收多播 IPv6 数据包

    我正在尝试使用此 python 2 7 代码在 Windows 上接收 IPv6 多播数据包 发送到 ff02 1 地址 import socket import win inet pton import struct socket IPP
  • IPv6 下网络字节顺序毫无意义吗?

    如果我们使用32位整数来存储IPv4地址 那么必须考虑该整数的字节顺序 但是 由于几乎所有平台下都没有内置的128位整数类型 因此IPv6地址必须存储到字节数组中 因此 我认为字节顺序不再是问题 我对么 或者IPv6有对应的函数htonlX
  • localhost 和 0.0.0.0 的 IPV6 是什么?

    众所周知 IPv4 地址localhost is 127 0 0 1 环回地址 IPv6 地址有什么用途localhost并为0 0 0 0因为我需要阻止一些广告主机 众所周知 IPv4 地址localhost is 127 0 0 1 环
  • 申请因缺乏 IPv6 支持而被拒绝 [已关闭]

    Closed 这个问题是基于意见的 help closed questions 目前不接受答案 My last release of application which is 12 8 is rejected by apple saying
  • 无法在辅助接口上接收 UDP/IPv6 数据包

    我有以下用于 UDP 服务器的 C 代码 它将绑定到辅助接口 tap0 的 ipv6 地址 context t new context const struct sockaddr listen addr size t addr size c
  • Spring 事务因 iptables 命令而挂起

    作为进程错误处理的一部分 我们尝试使用以下 iptables 命令禁用进程与数据库计算机侦听器端口之间的通信 iptables A INPUT p tcp destination port
  • 强制 InetAddress.getHostAddress() 返回 IPv4 地址

    我正在使用一个使用的库java net InetAddress getLocalHost getHostAddress 获取我的本地IP地址 然而 这总是在我的计算机上返回 IPv6 地址 Gentoo Linux JDK 1 6 0 37
  • IPv6:connect() 总是失败并显示 errno 22

    操作系统是Ubuntu 我正在对基本 IPv6 操作进行简单测试 PC通过集线器与IP Camera 支持IPv6 连接 ping6 测试成功 ping6 I eth1 fe80 240 8cff fe94 451e PING fe80 2
  • 使用 scapy 作为 MITM 即时更改数据包

    假设我设法处于客户端和服务器之间的通信中间 假设我打开一个热点并导致客户端仅通过我的机器连接到服务器 如何更改客户端发送和接收的数据包而不中断我自己与其他服务的通信 必须有一种方法可以通过我的脚本路由客户端发送和即将接收 在将它们转发给他之
  • 如何将 IPV6 地址转换为 IPV4 地址?

    我有使用 IPv4 地址的应用程序 它存储它们很长 因此它只理解 IPv4 地址 是否可以使用Java将IPv6地址转换为IPv4地址 While IPv4 地址范围有 IPv6 等效项 https en wikipedia org wik
  • nfq_get_payload 如何构造其返回数据?

    首先 我尝试从 Netfilter 队列有效负载的有效负载中获取源地址和目标端口 使用 nfq get payload 函数检索有效负载 下面的问题提出了同样的问题并得到了正确的答案 如何从 iptables 队列中的数据包中提取源端口号和
  • Perl IPTables 模块安装错误

    我一直在尝试为 perl 安装 IPTables 模块http metacpan org pod IPTables IPv4 http metacpan org pod IPTables 3a 3aIPv4我在安装过程中遇到了错误 我尝试在
  • 如何通过RAW套接字发送修改后的IPv6数据包?

    我正在尝试通过 C Linux 中的 RAW 套接字发送自定义 IPv6 标头 我已经使用 IP HDRINCL 套接字选项在 IPv4 中取得了成功 但是 IPv6 没有等效的选项 我找到了解决方法here http lists open
  • 正则表达式 IPv6 验证和可选的方括号?

    大家好 这里的正则表达式新手 我正在尝试编写一个验证 IPv6 地址的正则表达式 我还没有添加端口部分 我想先让地址部分工作 这是我到目前为止所拥有的 0 9A Fa f 这使得左括号和右括号是可选的 但正如您所看到的 它们是独立可选的 有
  • 如何使用链接本地 IPv6 地址访问 Web 服务器或网站?

    以下是托管 Web 服务器的计算机的 ipconfig 输出 以太网适配器本地连接 连接特定的 DNS 后缀 链路本地 IPv6 地址 fe80 f85b 4256 ee76 24a4 11 IPv4 地址 10 213 254 119 子
  • IPV6 Curl POST 请求

    在 IPV6 中 如何使用 IPV6 地址和端口号构建 CURL POST http 请求 任何类型的线程都将受到赞赏 尝试构建如下请求 gt curl interface http 2001 0 db8 1111 0 0 0 11 809
  • 用于验证 InetSocketAddresses 的正则表达式(ipv4/v6 + 端口地址)

    我在寻找testedipv4 和 ipv6 的正则表达式InetSocket地址 http download oracle com javase 6 docs api java net InetSocketAddress html toSt
  • IPv6中的/64是什么意思[关闭]

    Closed 这个问题是无关 help closed questions 目前不接受答案 我有ipv 6的vps 例如 2605 6f00 XXX XXXX XXXX 64 我不明白 64的含义 这是否意味着我的 vps 有多个 ipv6
  • getifaddrs() 结果发生变化时是否有通知机制?

    启动时 我的程序调用 getifaddrs 来查找哪些网络接口可用于链路本地 IPv6 多播 就目前而言 这是可行的 但它不能处理 getifaddrs 返回后可用网络接口集发生更改的情况 当网络接口发生更改时 操作系统是否有某种方式通知我

随机推荐