-
-
Notifications
You must be signed in to change notification settings - Fork 472
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
[Feature] Guide to use tunsocks on linux host as a gateway to other hosts ex: LXC containers and VMs #252
Comments
I also need this detailed documentation. |
@xjasonlyu If possible, could you please tell us how to configure gateway mode? The current wiki doesn't mention this at all. |
Technically, there is no such gateway mode. It's just a server/host with ip forwarding enabled. Therefore, to turn on "gateway mode", you only need to setup tun2socks as usual and enable the ip forwarding on your machine, e.g. To let LAN clients access internet via this gateway, just configuring your clients' gateway ip to your tun2socks server's ip. easy peasy :-P |
tried lot of methods, also by iptablez , did not work |
Gateway mode working fine. This is my test startup script for manual run and cleanup after finish. After run just set client gateway to server's address and all traffic going to shadowsocks-server.
|
But how to make it work on a router (I have ubuntu 20.04 configured as a router), I don't understand.
|
Same here, Ubuntu router, all other hosts traffic are not picked up by tun0
Gateway portion Did not work. sudo ip route add default via 192.168.43.1 dev enp3s0 metric 1 table 110 sudo ip rule add uidrange 1001-1001 lookup 110 pref 29000 pkexec --user psiphon ./psiphon-tunnel-core-x86_64 --config psiphone.conf #!/bin/bash sudo ip tuntap add mode tun dev tun0 sudo ip addr add 198.18.0.1/15 dev tun0 sudo ip link set dev tun0 up sudo ip route del default sudo ip route add default via 198.18.0.1 dev tun0 metric 1 sudo ip route add default via 192.168.43.1 dev enp3s0 metric 10 tun2socks -device tun0 -proxy socks5://127.0.0.1:2088 |
@n-r-w Hi! |
@Youaresmarter my full configuration https://github.com/n-r-w/tunnel |
it did not work for sure, waste your time |
@sonvirgo I didn't fully understand your post, but the configuration I described here https://github.com/n-r-w/tunnel works right now. |
Found out that UDP traffic is not routed :( @xjasonlyu do you have any adviсe? TCP works:server:
client:
UDP not working:server:
client:
|
All your script is holy crap |
@xjasonlyu This is host on local LAN, can not access internet through the tun2socks Try google also not work |
Done! Btw: Ubuntu NAT Router requires only 1 NIC. |
Guys this does work, it really just requires you to specify |
@n-r-w I know I'm late to the party but thank you bro, it finally worked for me thanks to your great script! You're a genius and great teacher |
I'm using a different configuration now. |
thanks for providing this, I'll check it later. But I'm surprised you too still using this, I thought I'm the only one who couldn't use the rust implementation of shadowsocks, I see it claimed that its' ss-redir solves the problem but couldn't manage to make it work my self. What do you think about it? |
In the configuration above, I do not use shadowsocks and tun2socks at all, because I could not make UDP work properly. Instead, I use Cloak + Wireguard. |
Description
[Feature] Guide to use tunsocks on linux host as a gateway to other hosts ex: LXC containers and VMs
the guide in the wiki shows configuration for single machine use.
Thanks
The text was updated successfully, but these errors were encountered: