Srar / node-tap

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

node-tap只有发送流量,没有接收流量 #69

Closed huangdog closed 5 years ago

huangdog commented 5 years ago

node-tap连上后虚拟网卡只有发送流量,没有接收流量,查看外网ip依然是原来的ip。 ss是可用的。我用gilder把ssr转成ss在另一台电脑上,给这台的node-tap用。排除节点问题。 glider相关参考#60

以下是log信息:

Welcome to use node sstap. $ .\sstap.exe --host 192.168.8.100 --port 8449 --passwd 1234 --xtudp 20 --method aes-256-cfb Route deletion failed. Code: 1168. Route: 10.198.75.255/255.255.255.255 IPv6 has been disabled. netsh interface ipv4 set interface 4 metric=1 netsh interface ipv6 set interface 4 metric=1 netsh interface ipv4 set dnsservers 4 static 8.8.8.8 primary netsh interface ip set address name=4 static 10.198.75.60 255.255.255.0 10.198.75.61 route delete 0.0.0.0 10.198.75.61 route delete 8.8.8.8 route add 192.168.8.100 mask 255.255.255.255 192.168.8.1 metric 1 route add 192.168.8.100 mask 255.255.255.255 192.168.8.1 metric 1 netsh int ipv6 delete route ::/0 interface=4 nexthop=fd05:5dd5:b158:0b23:0000:0000:0000:0004 netsh int ipv6 delete address interface=4 address=fd05:5dd5:b158:0b23:0000:0000:0000:0005 Unhandled Rejection at: Promise Promise {

Error: The specified module could not be found. \\?\C:\Users\aa\Desktop\node-sstap-gui\node_modules\cap\build\Release\cap.node at Object.Module._extensions..node (module.js:662:18) at Module.load (module.js:552:32) at tryModuleLoad (module.js:495:12) at Function.Module._load (module.js:487:3) at Module.require (module.js:577:17) at Module.require (pkg/prelude/bootstrap.js:1153:31) at require (internal/module.js:11:18) at Object. (C:\snapshot\node-tap\node_modules\cap\lib\Cap.js:3:13) at Module._compile (pkg/prelude/bootstrap.js:1243:22) at Object.Module._extensions..js (module.js:644:10) } reason: Error: The specified module could not be found. \\?\C:\Users\aa\Desktop\node-sstap-gui\node_modules\cap\build\Release\cap.node at Object.Module._extensions..node (module.js:662:18) at Module.load (module.js:552:32) at tryModuleLoad (module.js:495:12) at Function.Module._load (module.js:487:3) at Module.require (module.js:577:17) at Module.require (pkg/prelude/bootstrap.js:1153:31) at require (internal/module.js:11:18) at Object. (C:\snapshot\node-tap\node_modules\cap\lib\Cap.js:3:13) at Module._compile (pkg/prelude/bootstrap.js:1243:22) at Object.Module._extensions..js (module.js:644:10)
Srar commented 5 years ago

建议将跳过DNS参数加上后再尝试下。

huangdog commented 5 years ago

还是不行。 虚拟网卡只有发送流量,接受流量直接是0 依然能上外网,外网ip没变

C:\Users\aa\Desktop\aaa\node-sstap>sstap.exe --host 192.168.8.100 --port 8449 --passwd 1234 --xtudp 20 --method aes-256-cfb -skipdns true 2019-08-01 19:55:44 [warn] 删除路由失败: 169.254.0.0/255.255.0.0 2019-08-01 19:55:44 [warn] 删除路由失败: 169.254.169.163/255.255.255.255 2019-08-01 19:55:44 [warn] 删除路由失败: 169.254.255.255/255.255.255.255 2019-08-01 19:55:44 [warn] 删除路由失败: 224.0.0.0/240.0.0.0 2019-08-01 19:55:44 [warn] 删除路由失败: 255.255.255.255/255.255.255.255 2019-08-01 19:55:44 [info] IPv6已禁用. 2019-08-01 19:55:44 [info] 执行命令: netsh interface ipv4 set interface 4 metric=1 2019-08-01 19:55:44 [info] 执行命令: netsh interface ipv6 set interface 4 metric=1 2019-08-01 19:55:44 [info] 执行命令: netsh interface ipv4 set dnsservers 4 static 8.8.8.8 primary 2019-08-01 19:55:45 [info] 执行命令: netsh interface ip set address name=4 static 10.198.75.60 255.255.255.0 10.198.75.61 2019-08-01 19:55:45 [info] 执行命令: route delete 0.0.0.0 10.198.75.61 2019-08-01 19:55:45 [info] 执行命令: route delete 8.8.8.8 2019-08-01 19:55:45 [info] 执行命令: route add 192.168.8.100 mask 255.255.255.255 192.168.8.1 metric 1 2019-08-01 19:55:45 [info] 执行命令: route add 192.168.8.100 mask 255.255.255.255 192.168.8.1 metric 1 2019-08-01 19:55:45 [info] 执行命令: netsh int ipv6 delete route ::/0 interface=4 nexthop=fd05:5dd5:b158:0b23:0000:0000:0000:0004 2019-08-01 19:55:45 [info] 执行命令: netsh int ipv6 delete address interface=4 address=fd05:5dd5:b158:0b23:0000:0000:0000:0005 2019-08-01 19:55:45 [warn] 添加路由失败: 0.0.0.0/0.0.0.0 Unhandled Rejection at: Promise Promise {

Error: The specified module could not be found. \\?\C:\Users\aa\Desktop\aaa\node-sstap\node_modules\cap\build\Release\cap.node at Object.Module._extensions..node (module.js:662:18) at Module.load (module.js:552:32) at tryModuleLoad (module.js:495:12) at Function.Module._load (module.js:487:3) at Module.require (module.js:577:17) at Module.require (pkg/prelude/bootstrap.js:1153:31) at require (internal/module.js:11:18) at Object. (C:\snapshot\node-tap\node_modules\cap\lib\Cap.js:3:13) at Module._compile (pkg/prelude/bootstrap.js:1243:22) at Object.Module._extensions..js (module.js:644:10) } reason: Error: The specified module could not be found. \\?\C:\Users\aa\Desktop\aaa\node-sstap\node_modules\cap\build\Release\cap.node at Object.Module._extensions..node (module.js:662:18) at Module.load (module.js:552:32) at tryModuleLoad (module.js:495:12) at Function.Module._load (module.js:487:3) at Module.require (module.js:577:17) at Module.require (pkg/prelude/bootstrap.js:1153:31) at require (internal/module.js:11:18) at Object. (C:\snapshot\node-tap\node_modules\cap\lib\Cap.js:3:13) at Module._compile (pkg/prelude/bootstrap.js:1243:22) at Object.Module._extensions..js (module.js:644:10)
Srar commented 5 years ago

2019-08-01 19:55:45 [warn] 添加路由失败: 0.0.0.0/0.0.0.0 不知道啥原因路由添加失败了 请尝试下手动添加路由

huangdog commented 5 years ago

怎样操作?

Srar commented 5 years ago

route add 0.0.0.0 mask 0.0.0.0 10.198.75.61

huangdog commented 5 years ago

现在使用管理员权限运行cmd,添加路由那里没报错了 但问题依旧 只有发送流量没有接收流量,外网能上外网ip没变

C:\Users\aa\Desktop\aaa\node-sstap>sstap.exe --host 192.168.8.100 --port 8449 --passwd 1234 --xtudp 20 --method aes-256-cfb -skipdns true 2019-08-01 20:23:33 [info] 删除路由: 224.0.0.0/240.0.0.0 2019-08-01 20:23:33 [info] 删除路由: 255.255.255.255/255.255.255.255 2019-08-01 20:23:33 [info] IPv6已禁用. 2019-08-01 20:23:33 [info] 执行命令: netsh interface ipv4 set interface 4 metric=1 2019-08-01 20:23:34 [info] 执行命令: netsh interface ipv6 set interface 4 metric=1 2019-08-01 20:23:35 [info] 执行命令: netsh interface ipv4 set dnsservers 4 static 8.8.8.8 primary 2019-08-01 20:23:35 [info] 执行命令: netsh interface ip set address name=4 static 10.198.75.60 255.255.255.0 10.198.75.61 2019-08-01 20:23:35 [info] 执行命令: route delete 0.0.0.0 10.198.75.61 2019-08-01 20:23:36 [warn] 执行命令: route delete 8.8.8.8 错误信息: 路由删除失败: 找不到元素。 2019-08-01 20:23:36 [info] 执行命令: route add 192.168.8.100 mask 255.255.255.255 192.168.8.1 metric 1 2019-08-01 20:23:36 [warn] 执行命令: route add 192.168.8.100 mask 255.255.255.255 192.168.8.1 metric 1 错误信息: 路由添加失败: 对象已存在。 2019-08-01 20:23:36 [info] 执行命令: netsh int ipv6 delete route ::/0 interface=4 nexthop=fd05:5dd5:b158:0b23:0000:0000:0000:0004 2019-08-01 20:23:36 [info] 执行命令: netsh int ipv6 delete address interface=4 address=fd05:5dd5:b158:0b23:0000:0000:0000:0005 2019-08-01 20:23:36 [info] 添加路由: 0.0.0.0/0.0.0.0 Unhandled Rejection at: Promise Promise {

Error: The specified module could not be found. \\?\C:\Users\aa\Desktop\aaa\node-sstap\node_modules\cap\build\Release\cap.node at Object.Module._extensions..node (module.js:662:18) at Module.load (module.js:552:32) at tryModuleLoad (module.js:495:12) at Function.Module._load (module.js:487:3) at Module.require (module.js:577:17) at Module.require (pkg/prelude/bootstrap.js:1153:31) at require (internal/module.js:11:18) at Object. (C:\snapshot\node-tap\node_modules\cap\lib\Cap.js:3:13) at Module._compile (pkg/prelude/bootstrap.js:1243:22) at Object.Module._extensions..js (module.js:644:10) } reason: Error: The specified module could not be found. \\?\C:\Users\aa\Desktop\aaa\node-sstap\node_modules\cap\build\Release\cap.node at Object.Module._extensions..node (module.js:662:18) at Module.load (module.js:552:32) at tryModuleLoad (module.js:495:12) at Function.Module._load (module.js:487:3) at Module.require (module.js:577:17) at Module.require (pkg/prelude/bootstrap.js:1153:31) at require (internal/module.js:11:18) at Object. (C:\snapshot\node-tap\node_modules\cap\lib\Cap.js:3:13) at Module._compile (pkg/prelude/bootstrap.js:1243:22) at Object.Module._extensions..js (module.js:644:10)
Srar commented 5 years ago

http://www.win10pcap.org/ 这个安装后再尝试下

huangdog commented 5 years ago

感谢,问题解决了,果然是要安装http://www.win10pcap.org/

之前我还以为win10pcap 是虚拟网卡驱动,已经有虚拟网卡驱动安装好 就没理会这个。

ssr+glider变成ss 在电脑A 然后再用这个ss给node-tap用在电脑B ,效果不错

可以在同一台电脑玩 ssr,glider,node-tap 需要添加路由 route add (ssr服务器的ip) mask 255.255.255.255 (路由器网关ip)