iptables可以实现吗?

75次阅读

共计 1002 个字符,预计需要花费 3 分钟才能阅读完成。

iptables 可以实现吗?

https://github.com/wangyu-/tinyPortMapper
# you can also use 6-to-4 or 4-to-6 forward
./tinymapper_amd64 -l0.0.0.0:443 -r[2001:19f0:7001:1111:00:ff:11:22]:443 -t -u

xiaozhengnan 发表于 2022-9-1 10:26
基本上可以
也有可能不可以
具体能不能

听君一席话,如听一席话基本上可以
也有可能不可以
具体能不能
还要以实际为准. 你是想用 B 反代 A?

403_Forbidden 发表于 2022-9-1 10:31
你是想用 B 反代 A?

是的 A 的 ipv4 被商家封了

webjin 发表于 2022-9-1 10:42
是的 A 的 ipv4 被商家封了

当然可以啊,为什么不可以?v4 转 v6 用 socat 吧

zxxx 发表于 2022-9-1 10:46
v4 转 v6 用 socat 吧

试下了不行 socat 报 Connection refused 用个 nginx 反代一下配置文件如下
ip6tables -t nat -A PREROUTING -p tcp –dport 443 -j DNAT –to-destination [2605:a142:2084:0001:0000:0000:0000:0001]:443
ip6tables -t nat -A POSTROUTING-j MASQUERADE
socat TCP4-LISTEN:443,fork,su=nobody TCP6:[2001:19f0:6001:486e:0000:4ff:fe1f:b261]:443
以上配置在 2001:19f0:6001:486e:0000:4ff:fe1f:b261 正常机器上执行正确做法:两边起 wireguard 或其他隧道, 然后 A 机器上配置路由指向 B 即可。https://github.com/wangyu-/tinyPortMapper
# you can also use 6-to-4 or 4-to-6 forward
./tinymapper_amd64 -l0.0.0.0:443 -r[2001:19f0:7001:1111:00:ff:11:22]:443 -t -u

xiaozhengnan 发表于 2022-9-1 10:26
基本上可以
也有可能不可以
具体能不能

牛批如你 B 上用 Nginx 四层转发一下就可以了。

正文完
 0