Srar / node-tap

基于TypeScript实现的开源SSTap
Apache License 2.0
681 stars 150 forks source link

指定dns #32

Closed yogurt7771 closed 6 years ago

yogurt7771 commented 6 years ago

我自己搭建了一个分流的dns,但是指定dns之后无法上网了,(我还加了--skipdns true不知道是否有影响)

Srar commented 6 years ago

运行后在cmd中执行route print截图看下 注意打码

yogurt7771 commented 6 years ago

image

Srar commented 6 years ago

看起来你导入了国内路截图截不全。。那么你自行看下IPv4 Route Table里是否有

指定的DNS 255.255.255.255 192.168.31.1 192.168.31.180
yogurt7771 commented 6 years ago

有这条路由

Srar commented 6 years ago

那还请麻烦安装wireshark来查看是否DNS包通过了默认路由

yogurt7771 commented 6 years ago

通过默认路由了 image

image

Srar commented 6 years ago

麻烦提供下启动参数, 以及使用那个工具来添加国内路由表的 我在我本地尝试下能不能复现

yogurt7771 commented 6 years ago

启动参数就是--host xxx --port xxx --passwd xxx --method xxx --dns xxx --skipdns true 我认为与国内路由表无关,因为使用默认8.8.8.8的dns+国内路由表没有问题。 我的dns使用overture搭建的https://github.com/shawn1m/overture

yogurt7771 commented 6 years ago

刚刚发现了另一个问题,通过node-tap进行ping的全部time out,不知道是什么原因

Srar commented 6 years ago

麻烦请提供overture配置.

node-tap内部未实现ICMP

我在我内网尝试使用overture看起来一切都正常的

Srar commented 6 years ago

麻烦不用提供配置了, 我觉得可能已经重现.

Srar commented 6 years ago

貌似已经找到原因, 当设置skipdns后添加路由后windows部分软件的解析会跑默认网卡的dns 例如nslookup却使用了正确设置的DNS. 玄学问题具体原因还要再看看

yogurt7771 commented 6 years ago

我发现不加skipdns的话就不做任何关于dns的处理了,不知可否在skipdns=false的时候增加一条路由,把dns的ip指向tap

Srar commented 6 years ago

目前我也是打算这样处理 在tap内在加一个DNS转发器来解决这个玄学问题

yogurt7771 commented 6 years ago

不知大佬是否有在程序内部增加路由的打算?给个ip列表文件(或者PCA列表啥的)直接进行分流

Srar commented 6 years ago

目前可以直接通过routes参数来指定文件名, 启动时候会自动读取文件然后添加路由表. 不过貌似添加某些路由表后Windows的某个服务会出现问题 所以还没有写在readme上.

关于PAC文件分流的话需要实现一个DNS转发+解析器然后动态添加路由表 目前我个人时间不是很多所以暂时鸽了.

Srar commented 6 years ago

麻烦还请提供下overture的配置

Srar commented 6 years ago

这个版本是带有DNS转发的 麻烦请测试下是否正常 并且这个版本不带有依赖 sstap.zip

yogurt7771 commented 6 years ago

{ "BindAddress": "0.0.0.0:53", "PrimaryDNS": [ { "Name": "Native", "Address": "114.114.114.114:53", "Protocol": "udp", "SOCKS5Address": "", "Timeout": 6, "EDNSClientSubnet": { "Policy": "disable", "ExternalIP": "" } } ], "AlternativeDNS": [ { "Name": "Global", "Address": "8.8.8.8:53", "Protocol": "tcp", "SOCKS5Address": "127.0.0.1:11080", "Timeout": 6, "EDNSClientSubnet": { "Policy": "disable", "ExternalIP": "" } } ], "OnlyPrimaryDNS": false, "RedirectIPv6Record": false, "IPNetworkFile": "./china_ip.txt", "DomainBase64Decode": true, "HostsFile": "./hosts", "MinimumTTL": 0, "CacheSize" : 0, "RejectQtype": [255] }

yogurt7771 commented 6 years ago

这个版本可以正常访问了,参数还是--host xxx --port xxx --passwd xxx --method xxx --dns xxx --skipdns true

Srar commented 6 years ago

好的 谢谢反馈

Srar commented 6 years ago

后续会将这个版本上传至release 目前你可以临时使用上面的测试版本. 如果还是有问题麻烦再次开启issue.

yogurt7771 commented 6 years ago

好的,谢谢