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

提供一种电脑做网关的思路 #68

Open
fbion opened this issue Feb 25, 2020 · 0 comments
Open

提供一种电脑做网关的思路 #68

fbion opened this issue Feb 25, 2020 · 0 comments

Comments

@fbion
Copy link

fbion commented Feb 25, 2020

可以的
https://github.com/FlowerWrong/tun2socks
https://github.com/xjasonlyu/tun2socks
这两个已经实现fake dns
surge增强模式也是这样
有两种方式
google.com -> 192.18.0.1
google.com.hk -> 192.18.0.2

google.com -> 192.18.0.1:1111
google.com.hk -> 192.18.0.2:1112

通过这种关联即可

个人系统192.168.1.2开启
net.inet.ip.forwarding=1
开启tun2socks
sudo route add 198.18.0.2/24 240.0.0.1(tun网关)

手机设置网关192.168.1.2
所有流量走192.168.1.2了吧
192.168.1.2开启fake dns
手机dns服务器也设置为1.2
手机访问google.com 得到ip 192.18.0.1
手机连接192.18.0.1经过192.168.1.2
192.18.0.1走tun接口
tun2socks检测到访问192.18.0.1->google.com

此时tun2socks->v2ray inbounds
由v2ray来识别国外国内 google facebook twitter等域名

假如手机访问baidu,v2ray直接识别为geosite:cn ip 流量直接国内走

tun2socks只需要提供fake dns和代理功能
分流交给v2ray来做
这样

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant