Closed tony1016 closed 5 years ago
已经不建议用 dynamic routing。
其实可以加两条默认路由:https://github.com/eycorsican/go-tun2socks/blob/d0d16ba3c64f196ac4e2c1c1421cbe2296ba7055/proxy/d/tcp.go#L24
然后配置 v2ray 所有 outbound 的 sendThrough:https://github.com/eycorsican/go-tun2socks/blob/d0d16ba3c64f196ac4e2c1c1421cbe2296ba7055/proxy/d/tcp.go#L32
然后 freedom outbound 使用 UseIP。
这样一来其它 app 使用第一条路由转到 tun,再给到 v2ray,而由 v2ray 发出的所有流量就会使用第二条默认路由。
嗯,好主意,明白了
倒是成功了。可是如果是这样,那么网关的配置信息就变成要写死配置在v2ray的配置文件里了,那么岂不是很不方便,很不灵活?有没有什么解决方案??
看上面链接文件中的完整说明,但那种方法转发效率不高,而且也没什么本质变化
我的意思是v2ray的config中的这一行:
"sendThrough": "172.31.82.73",
这就变成在每个网络环境都要更改这一行。如果是是命令行参数,那还可以做到自动化,但是在配置文件中时,就不太好做了
明白你意思,按说明来配置,不需要在v2配置文件里做任何额外修改
windows没法用-ifscope en0命令,有什么替代方案吗
重点在于添加两条默认路由且到TUN的那条有较高优先级,windows可以直接添加多条默认路由,用metric参数设置优先级
重点在于添加两条默认路由且到TUN的那条有较高优先级,windows可以直接添加多条默认路由,用metric参数设置优先级
配置两条默认路由和sendThrough后,匹配direct规则的网站还是无法成功,看log好像还是死循环了
我的v2ray配置文件大概是这样子
开启动态路由:
然后我仅仅是尝试把114.114.114.114路由到该tun,用dig t.cn @114.114.114.114进行测试,结果日志像死循环一样: