davlxd / simple-vpn-demo Goto Github PK
View Code? Open in Web Editor NEWA Simple Point-to-Point tunnelling implementation in C
A Simple Point-to-Point tunnelling implementation in C
What protocol does this server use? This server is not support multiple connections. Are there any ready server software that can provide this?
运行程序后只看到Writing to tun 没有看到Writing to UDP 导致连接VPN无法上网
Terminal log:
write tun_fd error: Invalid argument
Execute iptables -t nat -D POSTROUTING -s 10.8.0.0/16 ! -d 10.8.0.0/16 -m comment --comment 'vpndemo' -j MASQUERADE
Execute iptables -D FORWARD -s 10.8.0.0/16 -m state --state RELATED,ESTABLISHED -j ACCEPT
Execute iptables -D FORWARD -d 10.8.0.0/16 -j ACCEPT
As is
我把这个demo deploy到本地的一个linux机器一切正常,然后我尝试把这个跑在阿里云,udp打开相关端口,但是手机端连上去以后,server 输出只有:
Writing to tun 59 bytes ...
Writing to tun 60 bytes ...
Writing to tun 81 bytes ...
Writing to tun 57 bytes ...
Writing to tun 58 bytes ...
Writing to tun 58 bytes ...
Writing to tun 71 bytes ...
Writing to tun 71 bytes ...
Writing to tun 71 bytes ...
似乎tun_fd永远没被set,请问有什么debug的想法吗
hello, i want to run this on tcp instead of udp.
I understand that it is slower but nonetheless i want to do it
i replaced all udp and UDP text in the vpn.c file with tcp or TCP but now on run i get this:
gcc -o vpn vpn.c -g -Wall
vpn.c: In function ‘tcp_bind’:
vpn.c:142:23: error: ‘IPPROTO_tcp’ undeclared (first use in this function)
hints.ai_protocol = IPPROTO_tcp;
^
vpn.c:142:23: note: each undeclared identifier is reported only once for each function it appears in
Makefile:2: recipe for target 'vpn' failed
make: *** [vpn] Error 1
方便留一下您的邮箱或者其他联系方式吗?
RT.Thx.
您好,我这边创建多个tun通道,但是发现只有第一个tun通道有数据可读,是因为iptable配置的问题吗
can't visit webside as google
i make it . server and client in two linux host;
it can send udp package.
but client can't visit google webside by server
I am trying to compile it on macOS Sierra and getting the following error.
gcc -o vpn vpn.c -g -Wall
vpn.c:14:10: fatal error: 'linux/if_tun.h' file not found
#include <linux/if_tun.h>
^
1 error generated.
make: *** [vpn] Error 1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.