xjasonlyu / tun2socks

tun2socks - powered by gVisor TCP/IP stack
https://github.com/xjasonlyu/tun2socks/wiki
GNU General Public License v3.0
2.85k stars 404 forks source link

[Bug] ping issues #297

Closed iLemonRain closed 6 months ago

iLemonRain commented 9 months ago

Verify steps

Version

f448baa

What OS are you seeing the problem on?

macOS

Description

作者您好,想来讨论一个代理ICMP流量的问题。 当前我打算使用tun2socks生成虚拟网卡接口utun123 ip:198.18.0.1,代理成ss流量到本地8080端口,再用gost监听本地8080端口,搭建隧道和服务端的gost通信。 这样当然要配置本地路由表,让我想代理的目标ip到198.18.0.1,tcp和udp流量都没问题。 但我ping站点的时候发现icmp报文实际上是由虚拟网卡198.18.0.1回复而不是我想访问的服务回复的,延迟非常低,流量没有走出物理网卡接口…… 大概是需要把icmp报文代理成ss的流量? 看过#39但是感觉太久远了,代码相差巨大,而且涉及gvisor有些没看懂。 请问有没有比较好的办法解决这个问题呢?十分感谢。

CLI or Config

No response

Logs

No response

How to Reproduce

No response

xjasonlyu commented 9 months ago

ICMP工作在L3层,代理工作在L4,这两个目前在理论上是没法实现转发的。

ps: 标题请用英文 :P

iLemonRain commented 9 months ago

ICMP工作在L3层,代理工作在L4,这两个目前在理论上是没法实现转发的。

ps: 标题请用英文 :P

谢谢! 请问怎样可以让utun123不响应icmp报文呢?打算直接监听所有icmp流量然后转发出去了。 Thanks! Is there any idea to make utun123 not response to icmp packets? I'd like to listen all icmp packets and forward them out.

ttimasdf commented 8 months ago

Is is possible to make an extension to socks protocol (or create a new transport) to handle ICMP with a compatible server?

iLemonRain commented 8 months ago

Is is possible to make an extension to socks protocol (or create a new transport) to handle ICMP with a compatible server?

You can try a UDP-based ping tool between a server and your PC to simulate ICMP communication. However, it is limited to ping only. Additionally, if the server does not belong to you, this idea may be impossible.

github-actions[bot] commented 6 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days