[Doc Bug] setup should mention that host can not be localhost and nameserver should be changed
sgon00 opened this issue · comments
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
andip 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
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.
@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 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.
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.
Standard SSH protocol doesn't support UDP. Why not try some real proxy tools like gost?
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 .
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