Giter Club home page Giter Club logo

vnt's Issues

Edge agent support

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.

windows 11 , wintun启动不成功

用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

Proxy support

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是否可以运行

win10是否可以运行?看着帮助没玩起来,能不能出个简单的操作流程

-W参数运行不久后报错

1.2.4 :-W参数说明里面并没有,已尝试-W和-W xxxxx方式,结果都一样。现象是执行一会儿后用vnt-cli --list会报错:
cmd: Resource temporarily unavailable (os error 11)
应该执行任何命令都会报错。

另外,在其中一台linux上用非root用户执行vnt-cli,会创建3个进程,都执行的同样的命令,sudo执行也一样,用root则不会

aarch64-apple-darwin

在今年 WWDC23 上,最后一款使用英特尔芯片的 Mac Pro 产品转变搭载 M2 Ultra 芯片,虽然比设想中的要迟了一年,但苹果依然是彻底告别了英特尔芯片时代。
只有历史版本的mac机器使用x86_64-apple-darwin架构
新机器将是aarch64-apple-darwin架构

能帮我Releases一个aarch64-apple-darwin吗

vns 客户端使用vnts域名连接时,报DNS query failed

客户端版本:v1.2.9 包:vnt-cli-aarch64-unknown-linux-musl-v1.2.9.tar.gz

在使用vnt-cli命令连接vnt服务端(服务端使用域名),无法解析出域名,但在客户端上运行nslookup是可以正常解析出域名地址的,另连服务端IP地址没有问题。

在win10/win11 下均出现类似问题

直接下载的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:"远程主机强迫关闭了一个现有的连接。"}

非正常断开连接会提示IP已存在?

# 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

Cannot read YAML File Properly

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 ======

使用ws协议无法连接上自建服务器

自建的 vnts服务器版本 1.2.11 阿里云服务器

客户端最新版本 1.2.11 openwrt里

使用tcp://服务器地址 可以链接
5V 7DJLII4OY5W$Y7Z_AGRX
使用ws://服务器地址无法连接
8`F5H)U2EIH%9NY%L_@{ B

服务器日志的如下
`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
`

ssh连上就断线

比如家里有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.

别的隧道方式都不会出现这种情况。

vnt-cli输出日志

将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经常stop, 如何查找问题

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"

win10操作系统启动报错

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端开源或者提供Server端执行程序吗?这样就可以搭建自己的服务而不是使用公共服务

自定义虚拟IP出错

虚拟IP只能是10.26.0.1/24,除了这个网段的IP都无法配置,报错:error ErrorType=InvalidIp

--list 提示 not started

进程有在

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" }

后台运行 会导致segment fault

nohup ./vnt-cli xxxx & 会导致segment fault

具体是,执行几分钟之后,就会崩溃,ps -ef 显示segment fault.
环境是ubuntu 20.04
前台运行不会崩溃。

在只读文件系统上提示错误,但是使用其他类似软件可以临时创建一个虚拟网卡,vnt则不行

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)

如何删除已占用的ip

不知道是不是id还是程序位置移动了,导致同一个机器无法使用希望的ip。显示offline
类似
ubuntu11 10.26.0.23 Offline
ubuntu11 10.26.0.3

subnet

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

linux run with error

➜ 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.

Service

Please consider to run the Windows binary without the need to install service.

新增功能请求

vnt-cli客户端能否增加一个--json的参数,这样可以方便其他程序调用返回参数。

不指定DNS

不指定DNS, 默认用114.114.114.114, 有时运营商会干扰,用了第三方的反而会不稳。
没有指定DNS的时候,默认还是用网卡获取到的DNS吧

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.