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

Failed to run on Android: [FATAL]open /dev/net/tun failed #1

Open githubtc opened 6 years ago

githubtc commented 6 years ago

1 ./tinyvpn -c -r XXX --sub-net 10.22.22.0 2 error: fatal open /dev/net/tun failed 3 https://stackoverflow.com/questions/24745398/how-to-open-tap-device-on-android-using-native-code-c 4 /dev/net/tun ? /dev/tun?

wangyu- commented 6 years ago

Looks like android's tun device is at different location,I will take a look.

x-liao commented 5 years ago

在android Linux depoly (debian9)上,看起来通讯成功了,但是ping不通,也没有办法传输其他数据,这个问题是由于android环境的限制吗

tinyvpn server:

[2019-02-28 10:23:07][INFO]sub_net 10.0.2.0 [2019-02-28 10:23:07][INFO]tun_dev=tun100 [2019-02-28 10:23:07][INFO]running at tun-dev mode [2019-02-28 10:23:07][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 [2019-02-28 10:23:07][INFO]using interface tun100 [2019-02-28 10:24:16][INFO]new connection from 113.13.12.212:27555 [2019-02-28 10:32:53][INFO]new connection from 113.13.12.212:27253 [2019-02-28 10:41:56][INFO]new connection from 113.13.12.212:27358

client tcpdump抓包:

10:42:33.254262 IP (tos 0x8, ttl 53, id 21331, offset 0, flags [DF], proto UDP (17), length 59) 111.230.241.12.30001 > 192.168.2.167.40829: [udp sum ok] UDP, length 31 10:42:34.481659 IP (tos 0x8, ttl 53, id 21467, offset 0, flags [DF], proto UDP (17), length 65) 111.230.241.12.30001 > 192.168.2.167.40829: [udp sum ok] UDP, length 37 10:42:35.611016 IP (tos 0x8, ttl 53, id 21470, offset 0, flags [DF], proto UDP (17), length 62) 111.230.241.12.30001 > 192.168.2.167.40829: [udp sum ok] UDP, length 34 10:42:36.836512 IP (tos 0x8, ttl 53, id 21644, offset 0, flags [DF], proto UDP (17), length 44) 111.230.241.12.30001 > 192.168.2.167.40829: [udp sum ok] UDP, length 16 10:42:38.067060 IP (tos 0x8, ttl 53, id 21668, offset 0, flags [DF], proto UDP (17), length 49) 111.230.241.12.30001 > 192.168.2.167.40829: [udp sum ok] UDP, length 21 10:42:39.294889 IP (tos 0x8, ttl 53, id 21689, offset 0, flags [DF], proto UDP (17), length 52) 111.230.241.12.30001 > 192.168.2.167.40829: [udp sum ok] UDP, length 24

server tcpdump抓包:

10.135.169.119.30001 > 113.13.12.212.27358: [bad udp cksum 0x3218 -> 0x4295!] UDP, length 31 10:42:34.720189 IP (tos 0x0, ttl 64, id 21467, offset 0, flags [DF], proto UDP (17), length 65) 10.135.169.119.30001 > 113.13.12.212.27358: [bad udp cksum 0x321e -> 0x6e75!] UDP, length 37 10:42:35.920182 IP (tos 0x0, ttl 64, id 21470, offset 0, flags [DF], proto UDP (17), length 62) 10.135.169.119.30001 > 113.13.12.212.27358: [bad udp cksum 0x321b -> 0x173f!] UDP, length 34 10:42:37.120233 IP (tos 0x0, ttl 64, id 21644, offset 0, flags [DF], proto UDP (17), length 44) 10.135.169.119.30001 > 113.13.12.212.27358: [bad udp cksum 0x3209 -> 0xfbb6!] UDP, length 16 10:42:38.320204 IP (tos 0x0, ttl 64, id 21668, offset 0, flags [DF], proto UDP (17), length 49) 10.135.169.119.30001 > 113.13.12.212.27358: [bad udp cksum 0x320e -> 0x69a0!] UDP, length 21 10:42:39.520182 IP (tos 0x0, ttl 64, id 21689, offset 0, flags [DF], proto UDP (17), length 52) 10.135.169.119.30001 > 113.13.12.212.27358: [bad udp cksum 0x3211 -> 0xdc6a!] UDP, length 24