大网数据广告活动
服务器运维问答

Port forward IPv6 to IPv4

· 52CE 我爱测

I have two servers, one is ROUTER - equiped with IPv6 IP and private IPv4 IP and the other one - WORKER has private IPv4 only. And I would like to configure NAT/port forward to access the second server through IPv6 of the first o…

问题原文

原帖链接 · FN_ · CC BY-SA 4.0

I have two servers, one is ROUTER - equiped with IPv6 IP and private IPv4 IP and the other one - WORKER has private IPv4 only. And I would like to configure NAT/port forward to access the second server through IPv6 of the first one.

So this will be possible and will connect me to WORKER server:

ssh user@2a02:xxxxxxx::1 -p 30123

I have also included diagram to better explain what I need to achieve.

Note: Both servers are Ubuntu 18.04

I have tried to configure iptables and socat, but no sucess so far.

My tries:

# Using socat
socat TCP6-LISTEN:30001,fork TCP4:192.168.1.1:22
# Using 6tunnel
6tunnel -6 30001 192.168.1.1 22

Does anyone have any experience with this kind of forward using IPv6? If yes, how to do it so?

已采纳解答

原帖链接 · FN_ · CC BY-SA 4.0

During debug I have discovered typo in command and after fixing it both commands work fine.

# Using socat
socat TCP6-LISTEN:30001,fork TCP4:192.168.1.1:22

# Using 6tunnel
6tunnel -6 30001 192.168.1.1 22

Creds

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2021-05-18)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。