|
本帖最后由 pllpii 于 2017-1-5 00:28 编辑
1、服务器搭建我是按照这个教程来的
https://www.leocode.net/article/index/19.html 记得开放防火墙端口
搭建完成后先用pc端测试,能连接上去证明服务器没问题
2、老毛子固件客户端配置,没有token
ngrokc -SER[Shost:替换域名,Sport:4443,Atoken:] -AddTun[Type:http,Lhost:192.168.10.1,Lport:80,Sdname:xihu] & #UI设置自动生成
3、我另外一个路由器是巴法络G450H刷的明月固件,ngrok-c和luci我是用下面这个教程里提供的,他说也是恩山上的大神编译的
https://www.shintaku.cc/posts/ngrok/
下图是/etc/config/ngrokc配置文件,一个是ngork.cc的,另一个是我自己搭建的
4、ngrok.cc openwrt命令行ssh下启动。
首先到ngrok.cc下载对应cpu的ngrokc客户端,解压或上传到路由器/xxx/ngrokc,ssh下设置权限chmod 777 /xxx/ngrokc,启动命令 /xxx/ngrokc -SER[Shost:server.ngrok.cc,Sport:4443,Atoken:xxxxxxx] -AddTun[Type:http,Lhost:127.0.0.1,Lport:80,Sdname:lalala] & ,想开机启动就vi /etc/rc.local,插入exit 0 的前一行保存退出。
多端口启动
/xxx/ngrokc -SER[Shost:server.ngrok.cc,Sport:4443,Atoken:xxxxxxx] \
-AddTun[Type:http,Lhost:127.0.0.1,Lport:80,Sdname:test] \
-AddTun[Type:https,Lhost:192.168.1.100,Lport:443,Sdname:test2] \
-AddTun[Type:tcp,Lhost:192.168.1.100,Lport:3389,Rport:18888]
5、注意事项
客户端填的域名要跟搭建服务器时写的域名一样,比如搭建时写的是三级域名,客户端也要填写三级域名,就算三级域名(xxx.xxx.xx)和二级域名(xx.xx)解析的ip一样都不能随便填,不然连接时会提示验证错误。
服务器启动时如果用的是80端口(httpAddr=":80"),登录路由器可以不用加端口,如果用的是其他端口(比如httpAddr=":5555"),那么登录路由器时必须加端口(http://xxx.ngrok.xxx.xx:5555),其他ssh等用途也一样。
6、实例
我服务器80端口被占用,用的是8888端口,所以连接成功后要穿透时需要加端口,比如第一图win端连接成功后生成的链接就加了端口号。ngrok.cc用的是80端口,直接xxxxx.ngrok.cc就可以登陆路由。6、总结
我的vps是搬瓦工的,搭建后速度白天和ngork.cc差不多,晚上比他的慢,vps不好的就别折腾了
也折腾过frp,老毛子固件用frp登录cpu占用老是飙到90-100%,挺占资源的。
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
×
|