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] UDP does not work #181

Closed EDK-Rise closed 1 year ago

EDK-Rise commented 1 year ago

Verify steps

Version

2.4.1

What OS are you seeing the problem on?

Windows

Description

i use local host that connected to shadowsocks+cloak server. tcp works well but udp does not work. my physical network card is: 192.168.1.2 and router is 192.168.1.1

CLI or Config

start cmd /k tun2socks.exe -loglevel "debug" -device tun://tun0 -proxy socks5://127.0.0.1:1080 netsh interface ip set address name="tun0" source=static addr=192.168.123.1 mask=255.255.255.0 gateway=none netsh interface ip set dns name="tun0" static 8.8.8.8 route add 192.168.1.2 mask 255.255.255.255 192.168.123.1 route add 0.0.0.0 mask 0.0.0.0 192.168.123.1

Logs

ime="2022-10-28T10:04:19+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:19+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:21+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:21+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:21+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:21+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:23+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:25+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:25+03:30" level=info msg="[TCP] 192.168.123.1:61333 <-> 23.61.80.154:443"
time="2022-10-28T10:04:25+03:30" level=info msg="[TCP] 192.168.123.1:61335 <-> 23.61.80.154:443"
time="2022-10-28T10:04:25+03:30" level=info msg="[TCP] 192.168.123.1:61338 <-> 23.61.80.154:443"
time="2022-10-28T10:04:25+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:25+03:30" level=info msg="[TCP] 192.168.123.1:61343 <-> 159.153.191.239:443"
time="2022-10-28T10:04:25+03:30" level=info msg="[TCP] 192.168.123.1:61346 <-> 3.234.112.11:443"
time="2022-10-28T10:04:26+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:26+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:26+03:30" level=info msg="[TCP] 192.168.123.1:61351 <-> 159.153.191.239:443"
time="2022-10-28T10:04:26+03:30" level=info msg="[TCP] 192.168.123.1:61354 <-> 159.153.191.239:443"
time="2022-10-28T10:04:27+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:27+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:27+03:30" level=info msg="[TCP] 192.168.123.1:61359 <-> 54.210.151.189:80"
time="2022-10-28T10:04:28+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:28+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:29+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:29+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:29+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:29+03:30" level=info msg="[TCP] 192.168.123.1:53186 <-> 8.8.8.8:53"
time="2022-10-28T10:04:30+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:30+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:30+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:30+03:30" level=info msg="[TCP] 192.168.123.1:53192 <-> 3.234.112.11:443"
time="2022-10-28T10:04:31+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:32+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:33+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:33+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:34+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:37+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:38+03:30" level=info msg="[TCP] 192.168.123.1:53211 <-> 216.58.206.163:443"
time="2022-10-28T10:04:37+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:38+03:30" level=info msg="[TCP] 192.168.123.1:53210 <-> 216.58.206.163:443"
time="2022-10-28T10:04:36+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:38+03:30" level=info msg="[TCP] 192.168.123.1:53209 <-> 216.58.206.163:443"
time="2022-10-28T10:04:39+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:40+03:30" level=info msg="[TCP] 192.168.123.1:53219 <-> 23.61.80.154:443"
time="2022-10-28T10:04:41+03:30" level=info msg="[TCP] 192.168.123.1:53224 <-> 159.153.191.240:443"
time="2022-10-28T10:04:41+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:42+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:42+03:30" level=info msg="[TCP] 192.168.123.1:53229 <-> 159.153.191.240:443"
time="2022-10-28T10:04:43+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:43+03:30" level=info msg="[TCP] 192.168.123.1:53233 <-> 149.154.175.57:443"
time="2022-10-28T10:04:43+03:30" level=info msg="[TCP] 192.168.123.1:53234 <-> 149.154.175.53:443"
time="2022-10-28T10:04:43+03:30" level=info msg="[TCP] 192.168.123.1:53239 <-> 149.154.175.57:80"
time="2022-10-28T10:04:43+03:30" level=info msg="[TCP] 192.168.123.1:53240 <-> 149.154.175.53:80"
time="2022-10-28T10:04:43+03:30" level=info msg="[TCP] 192.168.123.1:53245 <-> 159.153.191.238:443"
time="2022-10-28T10:04:44+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:45+03:30" level=info msg="[TCP] 192.168.123.1:53251 <-> 23.61.80.154:443"
time="2022-10-28T10:04:45+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:45+03:30" level=info msg="[TCP] 192.168.123.1:53257 <-> 3.234.112.11:443"
time="2022-10-28T10:04:46+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:46+03:30" level=info msg="[TCP] 192.168.123.1:53261 <-> 159.153.191.238:443"
time="2022-10-28T10:04:46+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"
time="2022-10-28T10:04:46+03:30" level=info msg="[TCP] 192.168.123.1:53267 <-> 23.61.80.154:443"
time="2022-10-28T10:04:46+03:30" level=info msg="[TCP] 192.168.123.1:53264 <-> 23.61.80.154:443"
time="2022-10-28T10:04:46+03:30" level=info msg="[TCP] 192.168.123.1:53271 <-> 23.61.80.154:443"
time="2022-10-28T10:04:46+03:30" level=info msg="[TCP] 192.168.123.1:53274 <-> 23.61.80.154:443"
time="2022-10-28T10:04:46+03:30" level=info msg="[TCP] 192.168.123.1:53277 <-> 23.61.80.154:443"
time="2022-10-28T10:04:46+03:30" level=info msg="[TCP] 192.168.123.1:53280 <-> 23.61.80.154:443"
time="2022-10-28T10:04:46+03:30" level=info msg="[TCP] 192.168.123.1:53283 <-> 23.61.80.154:443"
time="2022-10-28T10:04:46+03:30" level=info msg="[TCP] 192.168.123.1:53286 <-> 23.61.80.154:443"
time="2022-10-28T10:04:46+03:30" level=info msg="[TCP] 192.168.123.1:53289 <-> 23.61.80.154:443"
time="2022-10-28T10:04:46+03:30" level=info msg="[TCP] 192.168.123.1:53292 <-> 23.61.80.154:443"
time="2022-10-28T10:04:46+03:30" level=info msg="[TCP] 192.168.123.1:53295 <-> 23.61.80.154:443"
time="2022-10-28T10:04:46+03:30" level=warning msg="[UDP] dial 8.8.8.8:53: client handshake: UDP ASSOCIATE: command not supported"

How to Reproduce

start cmd /k tun2socks.exe -loglevel "debug" -device tun://tun0 -proxy socks5://127.0.0.1:1080 netsh interface ip set address name="tun0" source=static addr=192.168.123.1 mask=255.255.255.0 gateway=none netsh interface ip set dns name="tun0" static 8.8.8.8 route add 192.168.1.2 mask 255.255.255.255 192.168.123.1 route add 0.0.0.0 mask 0.0.0.0 192.168.123.1

xjasonlyu commented 1 year ago

It's not a BUG. The log indicates that your PROXY SERVER doesn't support UDP.

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