Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

端口跳跃不支持ipv6吗? #629

Closed
muziling opened this issue Jul 1, 2023 · 9 comments
Closed

端口跳跃不支持ipv6吗? #629

muziling opened this issue Jul 1, 2023 · 9 comments

Comments

@muziling
Copy link

muziling commented Jul 1, 2023

服务端做了类似iptables

iptables -t nat -A PREROUTING -i ens3 -p udp --dport 50000:60000 -j DNAT --to-destination :5678

客户端
配置"server": "ipv4地址50000-60000" 能正常连接
配置"server": "ipv6地址50000-60000" 就不能使用
配置"server": "ipv6地址5678" 是可以用的

@xtccc
Copy link

xtccc commented Jul 1, 2023

ip6tables 配置了吗?

# IPv4
iptables -t nat -A PREROUTING -i eth0 -p udp --dport 20000:50000 -j DNAT --to-destination :5666
# IPv6
ip6tables -t nat -A PREROUTING -i eth0 -p udp --dport 20000:50000 -j DNAT --to-destination :5666

@muziling
Copy link
Author

muziling commented Jul 2, 2023

还要配ip6tables呀,那是我不懂,学习了

@muziling muziling closed this as completed Jul 2, 2023
@geekbb
Copy link

geekbb commented Oct 6, 2023

ip6tables 配置了吗?

# IPv4
iptables -t nat -A PREROUTING -i eth0 -p udp --dport 20000:50000 -j DNAT --to-destination :5666
# IPv6
ip6tables -t nat -A PREROUTING -i eth0 -p udp --dport 20000:50000 -j DNAT --to-destination :5666

配了也不行
CleanShot 2023-10-06 at 16 12 28@2x

@haruue
Copy link
Collaborator

haruue commented Oct 6, 2023

ip6tables 配置了吗?

# IPv4
iptables -t nat -A PREROUTING -i eth0 -p udp --dport 20000:50000 -j DNAT --to-destination :5666
# IPv6
ip6tables -t nat -A PREROUTING -i eth0 -p udp --dport 20000:50000 -j DNAT --to-destination :5666

配了也不行
@geekbb

接口写对了吗? 很多机器的接口不叫 eth0

你可以贴出 ip r g 8.8.8.8 的输出, 会显示你的机器使用的默认接口。

另外我个人建议使用 iptables-save -t natip6tables-save -t nat 显示您当前使用的 iptables 规则, 更加符合人类阅读习惯。

@haruue haruue reopened this Oct 6, 2023
@haruue haruue closed this as completed Oct 6, 2023
@geekbb
Copy link

geekbb commented Oct 6, 2023

ip r g 8.8.8.8

谢谢建议,纯 IPV6 小鸡,套了WARP以支持访问IPV4内容,目前如果不使用端口跳跃则正常,使用后则不行
CleanShot 2023-10-06 at 20 31 51@2x

@haruue
Copy link
Collaborator

haruue commented Oct 6, 2023

ip r g 8.8.8.8

谢谢建议,纯 IPV6 小鸡,套了WARP以支持访问IPV4内容,目前如果不使用端口跳跃则正常,使用后则不行

@geekbb
那你发 ip -6 r 的输出吧。 刚才那个只能看到 ipv4 默认出口是 wrap 。

@geekbb
Copy link

geekbb commented Oct 6, 2023

ip -6 r
所以应该填写为 ens2 ?
CleanShot 2023-10-06 at 20 47 57@2x

@haruue
Copy link
Collaborator

haruue commented Oct 6, 2023

@geekbb
是的, 应该填写 ens2 。

ip6tables -t nat -A PREROUTING -i ens2 -p udp --dport 20000:50000 -j DNAT --to-destination :10010

@geekbb
Copy link

geekbb commented Oct 6, 2023

@geekbb 是的, 应该填写 ens2 。

ip6tables -t nat -A PREROUTING -i ens2 -p udp --dport 20000:50000 -j DNAT --to-destination :10010

搞定,感谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants