wangyu- / tinyfecVPN

A VPN Designed for Lossy Links, with Build-in Forward Error Correction(FEC) Support. Improves your Network Quality on a High-latency Lossy Link.
MIT License
2.33k stars 460 forks source link

新手请问下使用方法, #6

Closed JBlazingSun closed 6 years ago

JBlazingSun commented 6 years ago

假设你有一个server,ip为44.55.66.77,有一个服务监听tcp/udp 0.0.0.0:7777。

在server端运行:

./tinyvpn -s -l0.0.0.0:4096 -f20:10 -k "passwd" --sub-net 10.22.22.0

在client端运行:

./tinyvpn -c -r44.55.66.77:4096 -f20:10 -k "passwd" --sub-net 10.22.22.0

请问有一个服务监听7777端口是什么意思?
为什么监听了7777端口, 下面的server又要监听4096 端口呢 能否更详细点教程, 谢谢

wangyu- commented 6 years ago

有一个服务监听tcp/udp 0.0.0.0:7777。

这个是你要加速的服务的端口

下面的server又要监听4096 端口呢

这个是tinyFecVPN的端口。

JBlazingSun commented 6 years ago

意思是我用SS监听客户端端口7777, 然后tinyFecVPN监听4096 , 我只要连接SS的7777端口就能实现加速了吗?

我不明白为什么教程里写的监听服务器端口7777, 那我再连服务器端口的话, 客户端又有什么效果呢,

问题有点智障, 请见谅, 谢谢!

wangyu- commented 6 years ago

我不明白为什么教程里写的监听服务器端口7777, 那我再连服务器端口的话, 客户端又有什么效果呢,

你原来是用server的ip直接连,现在是通过tinyFecVPN分配的IP来连。通过tinyFecVPN分配的IP来连就是加速的。

JBlazingSun commented 6 years ago

那我就是以下使用步骤: 1.用SS监听服务器端口7777 2.tinyFecVPN监听服务器4096 3.客户端tinyFecVPN连接服务器4096端口 4.我只要连接服务器SS的7777端口就能实现加速了吗?

wangyu- commented 6 years ago

4.我只要连接服务器SS的7777端口就能实现加速了吗?

通过tinyFecVPN分配的IP来连

wangyu- commented 6 years ago

原来你是连44.55.66.77:7777

现在你连10.22.22.1:7777,你在填ip的地方把ip改一下。

JBlazingSun commented 6 years ago

可能是我表达的不对,我是以下使用场景: 1.家里Windows电脑需要加速游戏, 使用SSTAP作为代理软件 2.家里另一台ubuntu电脑作为tinyFecVPN客户端连接一台在香港的ubuntu(tinyFecVPN服务端)

我现在的疑问是现在Windows电脑如何设置呢?

再次感谢

wangyu- commented 6 years ago

参考这个连接,看里面tinyFecVPN运行在虚拟机/路由器的那节,对运行在另一台电脑上也适用。

https://github.com/wangyu-/tinyFecVPN/blob/master/doc/README.zh-cn.md#透过tinyfecvpn免改iptables加速网络

JBlazingSun commented 6 years ago

疏忽了readme, 我仔细看看

wangyu- commented 6 years ago

现在你的问题是s*** client 和tinyFecVPN不在同一台机器上,所以无法用10.22.22.1这个ip直接访问。

解决方法是,在ubuntu电脑上用我教你的那两条命令,把10.22.22.1:7777分享给局域网内的其他主机,然后你在windows上用 <ubuntun电脑的ip>:7777来访问就可以了。

JBlazingSun commented 6 years ago

对对对, 就是这个需求, 一开始我表达错了, 现在大概明白了

JBlazingSun commented 6 years ago

现在卡到了转发这一步, 在我的ubuntu机器上运行 socat UDP-LISTEN:443,fork,reuseaddr UDP:10.22.22.1:443 socat TCP-LISTEN:443,fork,reuseaddr TCP:10.22.22.1:443 没有任何返回值, 一直卡在那, 请问有遇到这样的情况吗

Caskia commented 6 years ago

@JBlazingSun 这个程序是挂起的, 你可以执行

socat UDP-LISTEN:443,fork,reuseaddr UDP:10.22.22.1:443 &
socat TCP-LISTEN:443,fork,reuseaddr TCP:10.22.22.1:443 &
wangyu- commented 6 years ago

现在卡到了转发这一步, 在我的ubuntu机器上运行 socat UDP-LISTEN:443,fork,reuseaddr UDP:10.22.22.1:443 socat TCP-LISTEN:443,fork,reuseaddr TCP:10.22.22.1:443 没有任何返回值, 一直卡在那, 请问有遇到这样的情况吗

就是这样的。你用sstap的测试,测试通过就表示没问题了,正常就是运行后没输出的。 我自己以前用sstap测试过,是没问题的。

你也可以参考@Caskia 的方法在后台运行。

我建议你在怀疑有问题前自己测试一下,也可以自己上网上找找socat的资料。

JBlazingSun commented 6 years ago

我下载的readme提供的虚拟机, 导入VBOX启动, 再用WinSCP复制了tinyvpn, 执行以下命令 root@LEDE:~# ./tinyvpn -c -r45.62.115.84:4096 -f20:10 -k "passwd" --sub-net 10.22.22.0 ./tinyvpn: line 1: syntax error: unexpected ")" 为啥会返回这个?

wangyu- commented 6 years ago

确保你拷贝的是tinyvpn_x86

JBlazingSun commented 6 years ago

噢噢, sorry, 之前一直用的ubuntu 所以只保留一份tinyvpn_amd64 ,而且还改名为tinyvpn, 所以就直接复制进了LEDE

JBlazingSun commented 6 years ago

现在又遇到个问题, VBOX里面安装ubuntu16运行命令如下: blazings@ubuntu:/home$ ./tinyvpn -s -l0.0.0.0:4096 -f20:10 -k "passwd" --sub-net 10.22.22.0 [2017-11-03 14:43:44][INFO]argc=8 ./tinyvpn -s -l0.0.0.0:4096 -f20:10 -k passwd --sub-net 10.22.22.0 [2017-11-03 14:43:44][INFO]sub_net 10.22.22.0 [2017-11-03 14:43:44][INFO]jitter_min=0 jitter_max=0 output_interval_min=0 output_interval_max=0 fec_timeout=8 fec_data_num=20 fec_redundant_num=10 fec_mtu=1250 fec_queue_len=200 fec_mode=0 [2017-11-03 14:43:44][INFO]using interface tun544 [2017-11-03 14:43:44][FATAL]open /dev/net/tun failed

请问这是啥 [FATAL]open /dev/net/tun failed

wangyu- commented 6 years ago

https://github.com/wangyu-/tinyFecVPN/blob/master/doc/README.zh-cn.md

重新看一遍。

JBlazingSun commented 6 years ago

服务端 blazings@ubuntu:/tmp$ sudo ./tinyvpn_amd64 -s -l192.168.0.126:4096 -f20:10 -k "passwd" --sub-net 10.22.22.0 [2017-11-03 17:42:45][INFO]argc=8 ./tinyvpn_amd64 -s -l192.168.0.126:4096 -f20:10 -k passwd --sub-net 10.22.22.0 [2017-11-03 17:42:45][INFO]sub_net 10.22.22.0 [2017-11-03 17:42:45][INFO]jitter_min=0 jitter_max=0 output_interval_min=0 output_interval_max=0 fec_timeout=8 fec_data_num=20 fec_redundant_num=10 fec_mtu=1250 fec_queue_len=200 fec_mode=0 [2017-11-03 17:42:45][INFO]using interface tun954

客户端 root@LEDE:~# ./tinyvpn -c -r192.168.0.126:4096 -f20:10 -k "passwd" --sub-net 10.22.22.0 [2017-11-03 09:43:26][INFO]argc=8 ./tinyvpn -c -r192.168.0.126:4096 -f20:10 -k passwd --sub-net 10.22.22.0 [2017-11-03 09:43:26][INFO]sub_net 10.22.22.0 [2017-11-03 09:43:26][INFO]jitter_min=0 jitter_max=0 output_interval_min=0 output_interval_max=0 fec_timeout=8 fec_data_num=20 fec_redundant_num=10 fec_mtu=1250 fec_queue_len=200 fec_mode=0 [2017-11-03 09:43:26][INFO]using interface tun838

为啥连不通呢, 服务端4096只监听了UDP