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

[Doc Bug] setup should mention that host can not be localhost and nameserver should be changed #341

Closed
2 tasks done
sgon00 opened this issue Feb 20, 2024 · 8 comments
Closed
2 tasks done
Labels

Comments

@sgon00
Copy link

sgon00 commented Feb 20, 2024

Verify steps

  • Is this something you can debug and fix? Send a pull request! Bug fixes and documentation fixes are welcome.
  • I have searched on the issue tracker for a related issue.

Version

any

What OS are you seeing the problem on?

Linux

Description

I followed https://github.com/xjasonlyu/tun2socks/wiki/Examples to setup environment. But it never works.
It took me many days to figure out what's going on.
Finally, I figued out:

  • socks5 host can not be localhost. There are many infinite loop issues. With v2ray direct outbound, it creates even more problems. Thus the doc should mention that the host can not be localhost.
  • even if when socks5 host is in another machine, if you want to make v2ray work in cn, the nameserver should be changed too. Without changing the default nameserver to non-cn nameserver, it won't work well.
  • ip route del default and ip route add default via 172.17.0.1 dev eth0 metric 10 are kinda useless from my experience.

I don't really care if this documentation issue will be fixed or not. As long as the issue exists, hopefully, it can help other people like me when using this tool.

Thanks a lot.

CLI or Config

No response

Logs

No response

How to Reproduce

No response

@xjasonlyu
Copy link
Owner

Sorry for the wiki, I understand that it is not very detailed.

To use a localhost socks5 or any kinds of proxy servers, you need to enable the interface bound option for your proxy servers, e.g. v2ray server has a sendThrough option in its outbound settings, which can be used to bind to a specific interface to avoid the infinite loop issue. https://www.v2fly.org/config/outbounds.html#outboundobject

Hope it helps.

@sgon00
Copy link
Author

sgon00 commented Feb 20, 2024

@xjasonlyu thank you very much for your reply. I just tried sendThrough and tried in many ways. It just doesn't work at all. I think I will only use v2ray proxy in another machine (actually in a VM with bridged nic). Localhost v2ray just causes too much troubles. Cheers.

@shakibamoshiri
Copy link

shakibamoshiri commented Mar 11, 2024

@sgon00 I am facing some similar issues ... #345
what do you mean by this socks5 host can not be localhost. ...

Do you mean it cannot be e.g. 127.0.0.1:PORT ?

@sgon00
Copy link
Author

sgon00 commented Mar 11, 2024

@shakibamoshiri yeah, it's better not be in the same host. Otherwise, you will need to workaround too many problems. It's better put in another host/computer. I am using a VM for this purpose.

@shakibamoshiri
Copy link

Thinking that this app could be the reason for the errors I saw, I complied badvpn and saw the same result.
The issue is not this app, it was SSH socks5 port forwarding that could not forward UDP traffic.

The app (tun2socks) is reliable as I tested with iperf3 with TCP and fast , but in practice opening sites like YouTube which has mixed UDP / TCP requests cases errors

So shortly the issue for me and probably yours are likely UDP requests could not go to socks5 servers. I think I should find an SSH client tool that supports UDP.

@xjasonlyu
Copy link
Owner

Standard SSH protocol doesn't support UDP. Why not try some real proxy tools like gost?

@shakibamoshiri
Copy link

I live in Iran -- the Hell of Internet users , has gotten much worse than China -- regardless of the protocol , that tool should support reverse tunnel , otherwise cannot operate well here .

Today tested wstunnel, which supports UDP and reverse tunnel , works fine, but it is slow comparing to openssh-client
This tool (tun2socks) is pretty useful and I think we should update the WiKi to add more realistic examples .

Copy link

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

@github-actions github-actions bot added the Stale label May 11, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants