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.31k stars 459 forks source link

10.22.22.1ping不通 #11

Closed helloxz closed 6 years ago

helloxz commented 6 years ago

服务端运行后信息如下:

[2017-11-09 00:25:35][INFO]argc=8 ./tinyvpn_amd64 -s -l0.0.0.0:4096 -f20:10 -k xiaoz.me --sub-net 10.22.22.0 
[2017-11-09 00:25:35][INFO]sub_net 10.22.22.0
[2017-11-09 00:25:35][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-09 00:25:35][INFO]using interface tun274

客户端信息如下:

[2017-11-09 16:31:01][INFO]argc=8 ./tinyvpn_amd64 -c -r172.104.xx.xxx:4096 -f20:10 -k xiaoz.me --sub-net 10.22.22.0 
[2017-11-09 16:31:01][INFO]sub_net 10.22.22.0
[2017-11-09 16:31:01][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-09 16:31:01][INFO]using interface tun834

无任何报错,但本地无法ping通10.22.22.1,请问是什么原因?

wangyu- commented 6 years ago

先按照这个文章里说的自己排查一下;如果排查后还是不行,补全一下你提供的信息。

https://github.com/wangyu-/UDPspeeder/wiki/发Issue前请看

helloxz commented 6 years ago
  1. 服务器、客户端均关闭了iptables
  2. 确保服务端已经运行,但是只有udp,无tcp是否正常?
    [root@li1684-104 ~]# netstat -an|grep '4096'
    udp        0      0 0.0.0.0:4096            0.0.0.0:* 
  3. 服务器:Linode JP2 Centos X64,本地VMware + CentOS 7虚拟机
  4. VMware桥接已指定网卡。 5 .日志 服务端:
    [2017-11-09 01:08:23][INFO]argc=11 ./tinyvpn_amd64 -s -l0.0.0.0:4096 -f20:10 -k xiaoz.me --sub-net 10.22.22.0 --log-level 5 --log-position 
    [2017-11-09 01:08:23][DEBUG]key=xiaoz.me
    [2017-11-09 01:08:23][INFO]sub_net 10.22.22.0
    [2017-11-09 01:08:23][INFO][UDPspeeder/misc.cpp,func:print_parameter,line:253]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-09 01:08:23][INFO][main.cpp,func:main,line:119]using interface tun129
    [2017-11-09 01:08:23][DEBUG][UDPspeeder/common.cpp,func:new_listen_socket,line:590]local_listen_fd=6
    ,[2017-11-09 01:08:23][DEBUG][tun_dev.cpp,func:tun_dev_server_event_loop,line:652]delay_manager.get_timer_fd()=4
    [2017-11-09 01:08:23][DEBUG][tun_dev.cpp,func:tun_dev_server_event_loop,line:667]conn_info.fec_encode_manager.get_timer_fd64()=4294967395
    [2017-11-09 01:08:23][DEBUG][tun_dev.cpp,func:tun_dev_server_event_loop,line:872]received packet from tun,but there is no client yet,dropped packet
    [2017-11-09 01:08:23][DEBUG][tun_dev.cpp,func:tun_dev_server_event_loop,line:872]received packet from tun,but there is no client yet,dropped packet
    [2017-11-09 01:08:23][DEBUG][tun_dev.cpp,func:tun_dev_server_event_loop,line:872]received packet from tun,but there is no client yet,dropped packet
    [2017-11-09 01:08:24][DEBUG][tun_dev.cpp,func:tun_dev_server_event_loop,line:872]received packet from tun,but there is no client yet,dropped packet
    [2017-11-09 01:08:25][DEBUG][tun_dev.cpp,func:tun_dev_server_event_loop,line:872]received packet from tun,but there is no client yet,dropped packet

    客户端:

    [2017-11-09 17:09:02][INFO]argc=11 ./tinyvpn_amd64 -c -r172.104.xx.xxx:4096 -f20:10 -k xiaoz.me --sub-net 10.22.22.0 --log-level 5 --log-position 
    [2017-11-09 17:09:02][DEBUG]key=xiaoz.me
    [2017-11-09 17:09:02][INFO]sub_net 10.22.22.0
    [2017-11-09 17:09:02][INFO][UDPspeeder/misc.cpp,func:print_parameter,line:253]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-09 17:09:02][INFO][main.cpp,func:main,line:119]using interface tun539
    [2017-11-09 17:09:02][DEBUG][UDPspeeder/common.cpp,func:new_connected_socket,line:615][172.104.74.104:4096]created new udp_fd 6
    [2017-11-09 17:09:02][DEBUG][tun_dev.cpp,func:tun_dev_client_event_loop,line:382]delay_manager.get_timer_fd()=4
    [2017-11-09 17:09:02][DEBUG][tun_dev.cpp,func:tun_dev_client_event_loop,line:397]conn_info.fec_encode_manager.get_timer_fd64()=4294967396
wangyu- commented 6 years ago

确保服务端已经运行,但是只有udp,无tcp是否正常?

正常

你用nc/ncat测试一下4096这个udp端口通不通

helloxz commented 6 years ago

本地客户端nc测试如下,实在找不到哪里原因了。

[root@localhost ~]# nc -u -vvv  172.104.xx.xxx 4096
Ncat: Version 6.40 ( http://nmap.org/ncat )
libnsock nsi_new2(): nsi_new (IOD #1)
libnsock nsock_connect_udp(): UDP connection requested to 172.104.xx.xxx (IOD #1) EID 8
libnsock nsock_trace_handler_callback(): Callback: CONNECT SUCCESS for EID 8 [172.104.xx.xxx:4096]
Ncat: Connected to 172.104.xx.xxx.
libnsock nsi_new2(): nsi_new (IOD #2)
libnsock nsock_read(): Read request from IOD #1 [172.104.xx.xxx] (timeout: -1ms) EID 18
libnsock nsock_readbytes(): Read request for 0 bytes from IOD #2 [peer unspecified] EID 26
wangyu- commented 6 years ago

本地客户端nc测试如下,实在找不到哪里原因了。

只有一边用nc测不出什么。

两边都换成nc,测试一下能否正常发送数据,双向。

helloxz commented 6 years ago

服务端是固定IP,客户端不是,客户端nc测服务好办。但是服务 -> 本地,那我测试哪个IP?在服务端nc 10.22.22.1?

wangyu- commented 6 years ago

你只要在客户端用nc连server的nc服务端就可以双向发送数据了。不需要反向连接。

helloxz commented 6 years ago

还是没懂,之前不是已经在客户端连接nc的server了吗?

[root@localhost ~]# nc -u -vvv  172.104.xx.xxx 4096
Ncat: Version 6.40 ( http://nmap.org/ncat )
libnsock nsi_new2(): nsi_new (IOD #1)
libnsock nsock_connect_udp(): UDP connection requested to 172.104.xx.xxx (IOD #1) EID 8
libnsock nsock_trace_handler_callback(): Callback: CONNECT SUCCESS for EID 8 [172.104.xx.xxx:4096]
Ncat: Connected to 172.104.xx.xxx.
libnsock nsi_new2(): nsi_new (IOD #2)
libnsock nsock_read(): Read request from IOD #1 [172.104.xx.xxx] (timeout: -1ms) EID 18
libnsock nsock_readbytes(): Read request for 0 bytes from IOD #2 [peer unspecified] EID 26
helloxz commented 6 years ago

实在抱歉,把你坑了,我在虚拟机ping 10.22.22.1是通的,但是有个问题请教,我是windows系统,要如何将10.22.22.1转发到我windows来用呢?

wangyu- commented 6 years ago

还是没懂,之前不是已经在客户端连接nc的server了吗?

你只是连上了,不发数据有什么用。之所以用nc,是为了测试从一边发送数据在另一边能否收到。

CloudnuY commented 6 years ago

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

helloxz commented 6 years ago

多谢帮助,问题应该能解决了。