xjasonlyu / tun2socks

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

[Bug] can't relay UDP under v2ray socks5 #165

Closed Taylor-lagrange closed 1 year ago

Taylor-lagrange commented 1 year ago

Verify steps

Version

2.4.1

What OS are you seeing the problem on?

Linux

Description

I use v2ray set up a sock5 proxy in addr 127.0.0.1:1080, but I find UDP can't be relay correctly.

When I check the code and capture net package, I find tun2socks send UDP ASSOCIATE request by ip 127.0.0.1, but later the udp pakage be relayed by ip 10.28.253.3, which is the ip of my interface wlp0s20f3. So the v2ray just drop this udp pakage silently.

image

image

when I change the code , force tun2socks use 127.0.0.1 to send upd relay pakage, problem fixed. But I'm not sure it's a bug or just I use tun2socks wrongly.

CLI or Config

tun2socks --loglevel debug --udp-timeout 20 --proxy socks5://127.0.0.1:1080 -interface wlp0s20f3 --device tun://tun0

Logs

No response

How to Reproduce

No response

xjasonlyu commented 1 year ago

You shouldn’t bind to an interface while using 127.0.0.1 as target proxy ip. Simply remove the interface parameter may do the trick.

Taylor-lagrange commented 1 year ago

You shouldn’t bind to an interface while using 127.0.0.1 as target proxy ip. Simply remove the interface parameter may do the trick.

oh, that work, thanks!

github-actions[bot] commented 1 year 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