xjasonlyu / tun2socks

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

udp cannot be used #18

Closed f4nff closed 3 years ago

f4nff commented 3 years ago
C:\Users\kuyer>nslookup -vc www.qq.com 8.8.8.8
服务器:  dns.google
Address:  8.8.8.8

非权威应答:
名称:    e6156.dscf.akamaiedge.net
Addresses:  2600:1406:1400:3a6::180c
          2600:1406:1400:386::180c
          184.31.186.46
Aliases:  www.qq.com
          news.qq.com.edgekey.net

C:\Users\kuyer>nslookup www.qq.com 8.8.8.8
DNS request timed out.
    timeout was 2 seconds.
服务器:  UnKnown
Address:  8.8.8.8

DNS request timed out.
    timeout was 2 seconds.
DNS request timed out.
    timeout was 2 seconds.
DNS request timed out.
    timeout was 2 seconds.
DNS request timed out.
    timeout was 2 seconds.
*** 请求 UnKnown 超时

C:\Users\kuyer>

socks5 server

https://github.com/ginuerzh/gost

gost -L=socks5://:1080

f4nff commented 3 years ago
./tun2socks-linux-amd64 --loglevel WARN --device tun://tun0 --proxy socks5://127.0.0.1:1080
ip addr add 10.0.0.1/24 dev tun0
ip link set dev tun0 up
ip route add default via 10.0.0.1 dev tun0 table 10
ip rule add from 192.168.6.109 table 10

这样倒是可以,我是丢到openwrt里面使用。

xjasonlyu commented 3 years ago

如果gost和tun2socks都在本机的话,是需要配置policy routing的,而且gost也需要绑定接口,不然会loop。

Saya47 commented 1 year ago

@xjasonlyu Hello I have the same issue! Can you tell me how to policy route on Linux?