vnt-dev / vnt Goto Github PK
View Code? Open in Web Editor NEWAn efficient VPN. 简便高效的异地组网、内网穿透工具
Home Page: https://rustvnt.com
License: Apache License 2.0
An efficient VPN. 简便高效的异地组网、内网穿透工具
Home Page: https://rustvnt.com
License: Apache License 2.0
Some devices cannot run third-party programs. But I can add a server next to it as a proxy server. And want to support one to many. Or it can be configured in the router.
用wintun的x86的dll
C:\Users\admin\Downloads\vnt-cli-i686-pc-windows-msvc-1.2.3.tar>vnt-cli.exe -k kkkkktest
version 1.2.3
====== Connect Successfully ======
virtual_gateway:10.26.0.1
virtual_ip:10.26.0.3
然后程序就自动退出来,没有继续打印,在别的设备用--list能看到这个windows设备短暂online,然后offline
用wintun的amd64的dll,github 的release下载的是32位的吧
C:\Users\admin\Downloads\vnt-cli-i686-pc-windows-msvc-1.2.3.tar>vnt-cli.exe -k kkkkktest
version 1.2.3
====== Connect Successfully ======
virtual_gateway:10.26.0.1
virtual_ip:10.26.0.3
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: Other, error: "wintun.dll not found LoadLibraryExW { source: Os { code: 193, kind: Uncategorized, message: \"%1 不是有效的 Win32 应用程序。\" } }" }', vnt-cli\src\main.rs:346:47
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Connetion being established based on v.1.2.13 Pre on debian12, how to route all data via debian12 to andoid phone running also on v.1.2.13 Pre pls? Many appreciations!
是否可以内置压缩,因为如果转发的是数据库流量,数据协议一般不压缩。
这个项目 https://github.com/zanjie1999/tcp-over-websocket 使用 tcping 根据 DNS TTL 更新服务端 IP ,可以参考一波吗→_→
please consider adding
http (connect) proxy and socks5 proxy support
to be able to connect to switchserver when you are behind one of these
win10是否可以运行?看着帮助没玩起来,能不能出个简单的操作流程
应该是用哪个版本?
1.2.4 :-W参数说明里面并没有,已尝试-W和-W xxxxx方式,结果都一样。现象是执行一会儿后用vnt-cli --list会报错:
cmd: Resource temporarily unavailable (os error 11)
应该执行任何命令都会报错。
另外,在其中一台linux上用非root用户执行vnt-cli,会创建3个进程,都执行的同样的命令,sudo执行也一样,用root则不会
在今年 WWDC23 上,最后一款使用英特尔芯片的 Mac Pro 产品转变搭载 M2 Ultra 芯片,虽然比设想中的要迟了一年,但苹果依然是彻底告别了英特尔芯片时代。
只有历史版本的mac机器使用x86_64-apple-darwin架构
新机器将是aarch64-apple-darwin架构
能帮我Releases一个aarch64-apple-darwin吗
虚拟ip登陆设备访问之后,使用lrzsz 上传文件和下载文件 ,发现上传90M的文件都失败
局域网段可以 ping 通,搞了好久也 ping 不通公网 ip,大家都是怎么配置 route 的?
比如局域网内有S1(服务器),有客户端C1,C2,C3, 网段R1,R2,R3,我希望C1可以访问S1,但是C2不能访问S1,简而言之就是网络访问权限控制,可以参考netbird的access-control功能
客户端版本:v1.2.9 包:vnt-cli-aarch64-unknown-linux-musl-v1.2.9.tar.gz
在使用vnt-cli命令连接vnt服务端(服务端使用域名),无法解析出域名,但在客户端上运行nslookup是可以正常解析出域名地址的,另连服务端IP地址没有问题。
如题,我用wifi路由表都能生效,显示的是P2P
目前把设备都联起来了,就差了ipad,不知道有没有IOS的适配计划?目前还是要另外搭建一个openvpn,搞两套有点麻烦了,想只用vnt搞定访问家里服务器。
直接下载的1.2.9版本的vnt-cli ,同目录下有 wintun.dll (win10 / win11 环境都试了的)
在以
vnt-cli -k <token>
运行后,先是获取了正常的结果
version 1.2.9
Serial:2405110136-349
但接着用如下命令时:
vnt-cli --info
获取了如下信息:
cmd: 0s {code: 10054,kind: ConnectionReset, message:"远程主机强迫关闭了一个现有的连接。"}
# vnt-cli -f /var/etc/vnt/conf.yaml
version 1.2.7
ip already exists
token: xxxxxxx
name: home
in_ips:
- 192.168.10.0/24,10.26.0.231
out_ips:
- 192.168.222.0/24
password: xxxxxx
ip: 10.26.0.230
punch_model: ipv4
RT.
建议启动前加上网卡判断vnt-tun 1...n,如果存在就禁用或者删除,否则导项目无法启动
Hi,
I've been tested the vnt-cli for couple days now. I realized that if I use the yaml file to configure the vnt client, the client does not read server address correctly.
Here is my yaml file:
token: $someTokenHere name: $HostnameHere password: $SomePasswordHere server: $ServerHostName:Port ip: $AssignedIPHere mtu: 1250 parallel: 16 no-proxy: true first-latency: true
When I use the yaml file above, the vnt-cli will give me invalid ip
error. Once I removed the server, I will get successful message like
version 1.2.8 ====== Connect Successfully ====== virtual_gateway:10.26.0.1 virtual_ip:10.26.0.2 ====== Create Network Interface Successfully ====== name:vnt-tun version: ====== Start Successfully ======
However, the server I run does not on the 10.26.0.1/24 virtual ip CIDR.
If I run the client by using command arguments, it works correctly.
Here is the result with command line:
version 1.2.8 ====== Connect Successfully ====== virtual_gateway:100.x.x.x virtual_ip:100.x.x.x ====== Create Network Interface Successfully ====== name:vnt-tun version: ====== Start Successfully ======
需要能存在多个中继服务并在p2p不通的情况下选择最低的进行中转保证网络通畅
自建的 vnts服务器版本 1.2.11 阿里云服务器
客户端最新版本 1.2.11 openwrt里
使用tcp://服务器地址 可以链接
使用ws://服务器地址无法连接
服务器日志的如下
`2024-07-02T01:50:03.060825799+02:00 [src/main.rs:256] INFO vnts:config:ConfigInfo { port: 1095, white_token: None, gateway: 10.26.0.1, broadcast: 10.26.0.255, netmask: 255.255.255.0, check_finger: false, username: "admin", password: "admin" }
2024-07-02T01:50:03.061079201+02:00 [src/main.rs:258] INFO vnts:监听udp端口: 1095
2024-07-02T01:50:03.061142224+02:00 [src/main.rs:261] INFO vnts:监听tcp/ws端口: 1095
2024-07-02T01:55:21.068422125+02:00 [src/main.rs:256] INFO vnts:config:ConfigInfo { port: 1095, white_token: None, gateway: 10.26.0.1, broadcast: 10.26.0.255, netmask: 255.255.255.0, check_finger: false, username: "admin", password: "admin" }
2024-07-02T01:55:21.068628993+02:00 [src/main.rs:258] INFO vnts:监听udp端口: 1095
2024-07-02T01:55:21.068672942+02:00 [src/main.rs:261] INFO vnts:监听tcp/ws端口: 1095
2024-07-02T07:17:51.309804775+02:00 [src/core/server/websocket/mod.rs:18] WARN vnts::core::server::websocket:websocket err Error during WebSocket handshake [::ffff:188.119.66.112]:63651
Caused by:
0: WebSocket protocol error: httparse error: invalid token
1: httparse error: invalid token
2: invalid token [::ffff:188.119.66.112]:63651
2024-07-02T12:50:41.885148128+02:00 [src/core/server/tcp.rs:32] WARN vnts::core::server::tcp:数据流读取失败 [::ffff:112.96.50.174]:3174
2024-07-02T12:51:25.722171395+02:00 [src/core/server/tcp.rs:32] WARN vnts::core::server::tcp:数据流读取失败 [::ffff:112.96.50.174]:37906
2024-07-02T12:53:46.481462929+02:00 [src/core/server/tcp.rs:32] WARN vnts::core::server::tcp:数据流读取失败 [::ffff:112.96.50.174]:37907
2024-07-03T05:05:35.033059392+02:00 [src/core/server/websocket/mod.rs:18] WARN vnts::core::server::websocket:websocket err Error during WebSocket handshake [::ffff:42.240.145.70]:17362
Caused by:
0: WebSocket protocol error: No "Connection: upgrade" header
1: No "Connection: upgrade" header [::ffff:42.240.145.70]:17362
2024-07-03T05:05:35.564224862+02:00 [src/core/server/websocket/mod.rs:18] WARN vnts::core::server::websocket:websocket err Error during WebSocket handshake [::ffff:42.240.145.70]:17372
Caused by:
0: WebSocket protocol error: httparse error: invalid token
1: httparse error: invalid token
2: invalid token [::ffff:42.240.145.70]:17372
2024-07-03T05:05:39.088561009+02:00 [src/core/server/tcp.rs:32] WARN vnts::core::server::tcp:数据流读取失败 [::ffff:42.240.145.70]:17378
2024-07-03T05:05:39.360331866+02:00 [src/core/server/websocket/mod.rs:18] WARN vnts::core::server::websocket:websocket err Error during WebSocket handshake [::ffff:42.240.145.70]:17416
Caused by:
0: WebSocket protocol error: HTTP version must be 1.1 or higher
1: HTTP version must be 1.1 or higher [::ffff:42.240.145.70]:17416
2024-07-03T05:05:39.889503726+02:00 [src/core/server/websocket/mod.rs:18] WARN vnts::core::server::websocket:websocket err Error during WebSocket handshake [::ffff:42.240.145.70]:17420
Caused by:
0: WebSocket protocol error: httparse error: invalid token
1: httparse error: invalid token
2: invalid token [::ffff:42.240.145.70]:17420
2024-07-03T05:05:40.423376189+02:00 [src/core/server/websocket/mod.rs:18] WARN vnts::core::server::websocket:websocket err Error during WebSocket handshake [::ffff:42.240.145.70]:17422
Caused by:
0: WebSocket protocol error: httparse error: invalid token
1: httparse error: invalid token
2: invalid token [::ffff:42.240.145.70]:17422
2024-07-03T05:05:40.947300031+02:00 [src/core/server/websocket/mod.rs:18] WARN vnts::core::server::websocket:websocket err Error during WebSocket handshake [::ffff:42.240.145.70]:17438
Caused by:
0: WebSocket protocol error: httparse error: invalid token
1: httparse error: invalid token
2: invalid token [::ffff:42.240.145.70]:17438
2024-07-03T05:05:41.499296575+02:00 [src/core/server/websocket/mod.rs:18] WARN vnts::core::server::websocket:websocket err Error during WebSocket handshake [::ffff:42.240.145.70]:17444
Caused by:
0: WebSocket protocol error: httparse error: invalid token
1: httparse error: invalid token
2: invalid token [::ffff:42.240.145.70]:17444
2024-07-03T05:05:42.021716424+02:00 [src/core/server/websocket/mod.rs:18] WARN vnts::core::server::websocket:websocket err Error during WebSocket handshake [::ffff:42.240.145.70]:17458
Caused by:
0: WebSocket protocol error: httparse error: invalid token
1: httparse error: invalid token
2: invalid token [::ffff:42.240.145.70]:17458
`
比如家里有openwrt路由器和unraid,都开了ssh服务。
在公司用vnt打洞回家成功后,使用xshell ssh连openwrt和unraid,连上半分钟内必定会自动断开
root@OpenWrt:~#
root@OpenWrt:~# Connection closing...Socket close.
Connection closed by foreign host.
Disconnected from remote host(192.168.6.1) at 16:11:20.
别的隧道方式都不会出现这种情况。
将log4rs.yaml文件放到vnt-cli同目录下,到该目录启动vnt-cli,将会有输出日志到./log目录中。log4rs.yaml可以参考:
# cat log4rs.yaml
refresh_rate: 30 seconds
appenders:
rolling_file:
kind: rolling_file
path: log/vnt-cli.log
append: true
encoder:
pattern: "{d} [{f}:{L}] {h({l})} {M}:{m}{n}"
policy:
kind: compound
trigger:
kind: size
limit: 5 mb
roller:
kind: fixed_window
pattern: log/vnt-cli.{}.log
base: 1
count: 5
root:
level: info
appenders:
- rolling_file
Alpine Linux 3.20 下不管nohup还是使用openrc,一段时间后都会stop。 另外一个ubuntu22没出现
version 1.2.9
Serial:240
exe cmd: ifconfig vnt-tun txqueuelen 1000
create_tun name=vnt-tun ,version=
connect count=1 ,address=8.134.146.7:29872
handshake no_secret server version=1.2.9
register ip=10.26.0.23 ,netmask=255.255.255.0 ,gateway=10.26.0.1
exe cmd: ip route add 10.26.0.0/255.255.255.0 dev vnt-tun
exe cmd: ip route add 255.255.255.255/255.255.255.255 dev vnt-tun
exe cmd: ip route add 224.0.0.0/240.0.0.0 dev vnt-tun
====== Connect Successfully ======
stopped
#!/sbin/openrc-run
#supervisor=supervise-daemon
name="vnt"
command="vnt-cli"
command_args="-k xxx -n xxx --ip 10.26.0.23"
command_background=true
pidfile="/run/${name}.pid"
C:\Users\Administrator\Desktop\vnt>vnt-cli.exe -k 123456
version 1.2.3
====== Connect Successfully ======
virtual_gateway:10.26.0.1
virtual_ip:10.26.0.5
thread 'main' panicked at 'called Result::unwrap()
on an Err
value: Custom { kind: Other, error: "Custom { kind: Other, error: "Failed to crate adapter" }" }', vnt-cli\src\main.rs:346:47
note: run with RUST_BACKTRACE=1
environment variable to display a backtrace
会Server端开源或者提供Server端执行程序吗?这样就可以搭建自己的服务而不是使用公共服务
虚拟IP只能是10.26.0.1/24
,除了这个网段的IP都无法配置,报错:error ErrorType=InvalidIp
想把手机也纳入组网
有没有大佬能做个magisk模块版本
进程有在
root@opmain:~# ps |grep vnt
5352 root 11172 S /usr/bin/vnts --port 65534 --gateway 10.26.0.1 --netmask 255.255.255.0
15302 root 16928 S /usr/bin/vnt-cli -f /var/etc/vnt/conf.yaml
15577 root 1228 S grep vnt
root@opmain:~# /usr/bin/vnt-cli --list
cmd: Custom { kind: Other, error: "not started" }
维护服务器的时候用的多,不知道能不能?测试不行,目前的gui版本
nohup ./vnt-cli xxxx & 会导致segment fault
具体是,执行几分钟之后,就会崩溃,ps -ef 显示segment fault.
环境是ubuntu 20.04
前台运行不会崩溃。
1、直接执行
root@imx8mqevk:/opt/ycx-bak/vnt# ./vnt-cli -k 123456
thread 'main' panicked at vnt-cli/src/config/mod.rs:170:42:
called Result::unwrap()
on an Err
value: Os { code: 30, kind: ReadOnlyFilesystem, message: "Read-only file system" }
note: run with RUST_BACKTRACE=1
environment variable to display a backtrace
Aborted
2、增加-d参数
root@imx8mqevk:/opt/ycx-bak/vnt# ./vnt-cli -k 123456 -d test
version 1.2.8
====== Connect Successfully ======
virtual_gateway:10.26.0.1
virtual_ip:10.26.0.12
====== Create Network Interface Successfully ======
name:vnt-tun
version:
====== Start Successfully ======
command error :Read-only file system (os error 30)
不知道是不是id还是程序位置移动了,导致同一个机器无法使用希望的ip。显示offline
类似
ubuntu11 10.26.0.23 Offline
ubuntu11 10.26.0.3
please consider to add a subnets parameter
switch-desktop.exe start --subnets 172.11.64.0/22,192.168.1.1/32
so other enabled peers can access the client subnets remote network
vnt-cli无法正确识别配置文件中的cipher_model配置,目前仅支持默认的aes_gcm
➜ sudo RUST_BACKTRACE=1 /tmp/switch/target/debug/switch-desktop --token xxx
starting...
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Io(Os { code: 19, kind: Uncategorized, message: "No such device" })', switch/src/tun_device/linux.rs:31:40
stack backtrace:
0: rust_begin_unwind
at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:575:5
1: core::panicking::panic_fmt
at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/panicking.rs:64:14
2: core::result::unwrap_failed
at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/result.rs:1791:5
3: core::result::Result<T,E>::unwrap
at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/result.rs:1113:23
4: switch::tun_device::linux::create_tun
at ./switch/src/tun_device/linux.rs:31:19
5: switch::Switch::start_::{{closure}}
at ./switch/src/lib.rs:145:13
6: tokio::runtime::park::CachedParkThread::block_on::{{closure}}
at /home/zhijia/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.25.0/src/runtime/park.rs:283:63
7: tokio::runtime::coop::with_budget
at /home/zhijia/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.25.0/src/runtime/coop.rs:102:5
8: tokio::runtime::coop::budget
at /home/zhijia/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.25.0/src/runtime/coop.rs:68:5
9: tokio::runtime::park::CachedParkThread::block_on
at /home/zhijia/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.25.0/src/runtime/park.rs:283:31
10: tokio::runtime::context::BlockingRegionGuard::block_on
at /home/zhijia/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.25.0/src/runtime/context.rs:315:13
11: tokio::runtime::scheduler::multi_thread::MultiThread::block_on
at /home/zhijia/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.25.0/src/runtime/scheduler/multi_thread/mod.rs:66:9
12: tokio::runtime::runtime::Runtime::block_on
at /home/zhijia/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.25.0/src/runtime/runtime.rs:284:45
13: switch::Switch::start
at ./switch/src/lib.rs:48:22
14: switch_desktop::main
at ./switch-desktop/src/main.rs:78:18
15: core::ops::function::FnOnce::call_once
at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/ops/function.rs:507:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Please consider to run the Windows binary without the need to install service.
vnt-cli客户端能否增加一个--json的参数,这样可以方便其他程序调用返回参数。
不指定DNS, 默认用114.114.114.114, 有时运营商会干扰,用了第三方的反而会不稳。
没有指定DNS的时候,默认还是用网卡获取到的DNS吧
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.