Closed helloxz closed 6 years ago
先按照这个文章里说的自己排查一下;如果排查后还是不行,补全一下你提供的信息。
[root@li1684-104 ~]# netstat -an|grep '4096'
udp 0 0 0.0.0.0:4096 0.0.0.0:*
[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
确保服务端已经运行,但是只有udp,无tcp是否正常?
正常
你用nc/ncat测试一下4096这个udp端口通不通
本地客户端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
本地客户端nc测试如下,实在找不到哪里原因了。
只有一边用nc测不出什么。
两边都换成nc,测试一下能否正常发送数据,双向。
服务端是固定IP,客户端不是,客户端nc测服务好办。但是服务 -> 本地,那我测试哪个IP?在服务端nc 10.22.22.1?
你只要在客户端用nc连server的nc服务端就可以双向发送数据了。不需要反向连接。
还是没懂,之前不是已经在客户端连接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
实在抱歉,把你坑了,我在虚拟机ping 10.22.22.1是通的,但是有个问题请教,我是windows系统,要如何将10.22.22.1转发到我windows来用呢?
还是没懂,之前不是已经在客户端连接nc的server了吗?
你只是连上了,不发数据有什么用。之所以用nc,是为了测试从一边发送数据在另一边能否收到。
多谢帮助,问题应该能解决了。
服务端运行后信息如下:
客户端信息如下:
无任何报错,但本地无法ping通10.22.22.1,请问是什么原因?