GithubHelp home page GithubHelp logo

fubuki's Introduction

fubuki

Release

fubuki是网状VPN实现,用于不同内网机器之间相互通信

当前支持的平台:

  • Windows
  • Linux
  • macOS

受支持的协议类型:

  • P2P: UDP
  • 中继: UDP, TCP

工作模式:

它通过一台公网服务器来同步多个节点的地址映射与存活状态。每个节点启动之后会存在一个唯一的虚拟地址,节点加入网段服务端会向所有对等节点同步状态信息并协调节点之间打洞,如受NAT限制等原因通讯建立失败后会回退至服务端中继。

Usage

Usage: fubuki <COMMAND>

Commands:
  server  coordinator and data relay server
  node    fubuki node
  help    Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

配置文档

前置依赖

Windows
  • 必须以管理员权限运行
  • 需要wintun.dll(https://www.wintun.net) 与程序同目录或System32下
  • 启用allowed_ips配置项时系统须支持NetNat命令
Linux
  • 必须以root权限运行
  • 内核需支持tun模块
  • 启用allowed_ips配置项时系统须支持iptables
macOS
  • 必须以root权限运行
  • 内核需支持tun模块
  • 启用allowed_ips配置项时系统须支持pfctl

Fubuki server

创建fubuki服务端的配置 server-config.json

{
  "groups": [
    {
      "name": "mygroup",
      "key": "123",
      "listen_addr": "0.0.0.0:12345",
      "address_range": "10.0.0.0/24"
    }
  ]
}
  • name: 组名为 "mygroup"
  • key: 该组的预共享密钥
  • listen_addr: fubuki server监听地址
  • address_range: 配置的虚拟网段

启动 fubuki server

fubuki server daemon ./server-config.json

Fubuki node

创建fubuki节点的配置 node-config.json

{
  "groups": [
    {
      "node_name": "node1",
      "server_addr": "{fubuki server address}",
      "key": "123"
    }
  ]
}
  • node_name: 节点名
  • server_addr: 服务器地址,格式为 IP:PORT
  • key: 预共享密钥

启动 fubuki node

fubuki node daemon ./node-config.json

启动第二个节点

{
  "groups": [
    {
      "node_name": "node2",
      "server_addr": "{fubuki server address}",
      "key": "123"
    }
  ]
}

ping node2节点,可以使用 {node_name}.{group_name} 形式

ping node2.mygroup

Build

  • Rust nightly toolchain
  • Windows
    • MSVC toolchain
cargo +nightly build --release

包含 Web UI

  • Node.js >= 16.*
  • Angular CLI
cargo +nightly build --release --features "web"

包含 GUI

cargo +nightly build --release --features "gui"

fubuki's People

Contributors

aluneed avatar wkgcass avatar xutianyi1999 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

fubuki's Issues

thread 'tokio-runtime-worker' has overflowed its stack

fubuki.exe node daemon ./node-config.json
[2023-08-23 19:30:18] INFO fubuki::node::api - api listening on http://127.0.0.1:3030
[2023-08-23 19:30:18] ERROR
thread 'tokio-runtime-worker' has overflowed its stack

不知道是何原因

proxy support

please consider adding
http proxy (connect) and socks5 proxy support
to be able to connect to server when you are behind one of these

great work keep it up!
kudos for the version 0.50 milestone!

routed subnet

please consider to add support to route peer subnet network range
something like wireguard AllowedIPs:

"network_ranges": [
{
"server_addr": "102.129.255.0:12345",
"tun": {
"ip": "192.168.1.110",
"netmask": "255.255.255.0",
"AllowedIPs": "172.168.80.0/20"

打洞能力很弱,需要两端都是全锥型才能p2p

甲骨文服务器,如果不放开相关udp端口,是不能建立起p2p的。使用tailscale没问题。
经测试,需要两端都是全锥型才能p2p,还达不到n2n的打洞能力,虽然n2n不那么厉害,但是可以一端全锥即可p2p。

另外,建议可以指定源port,方便开放源udp端口

allowed_ips

there are some requirements for using allowed_ips on windows?

adding the option:

ERROR simple_wintun::adapter - Delete wintun driver error: OS Error -536870339 (FormatMessageW() returned error 317) (os error -536870339)
node xxx tcp handler error

Caused by:
add nat record failed

No such file or directory (os error 2)

sudo ./fubuki node daemon node-config.json 
No such file or directory (os error 2)

不知道为何报这个错误,没有更详细的日志。
系统信息: aarch64 GNU/Linux Linux version 4.4.18-g8bcbd8a-dirty,gcc version 4.9.4 (OpenWrt/Linaro GCC 4.9-2015.06 r48422)

Binaries

Please consider to release the windows binaries

tcp handler error: Timeout,但telnet 服务端端口正常,是什么原因呢

[2023-11-21 14:31:21] INFO fubuki::node::api - api listening on http://127.0.0.1:3030
[2023-11-21 14:31:21] ERROR fubuki::node - node node_sa tcp handler error: Timeout
[2023-11-21 14:31:24] ERROR fubuki::node - node node_sa tcp handler error: Timeout
[2023-11-21 14:31:27] ERROR fubuki::node - node node_sa tcp handler error: Timeout
[2023-11-21 14:31:30] ERROR fubuki::node - node node_sa tcp handler error: Timeout
[2023-11-21 14:31:33] ERROR fubuki::node - node node_sa tcp handler error: Timeout

stream did not contain valid UTF-8

name = "fubuki"
operating_system = "Windows 10.0.17763 (Windows Server 2019 Standard) [64-bit]"
crate_version = "0.5.3"
explanation = '''
Panic occurred in file 'C:\Users\runneradmin\.cargo\git\checkouts\innernet-e473261454a9fbf4\376ab64\hostsfile\src\lib.rs' at line 206
'''
cause = "called `Result::unwrap()` on an `Err` value: Error { kind: InvalidData, message: \"stream did not contain valid UTF-8\" }"
method = "Panic"
backtrace = """

   0: 0x7ff7177a6874 - <unresolved>
   1: 0x7ff7176d6474 - <unresolved>
   2: 0x7ff7176d38de - <unresolved>
   3: 0x7ff71757927d - <unresolved>
   4: 0x7ff717761817 - <unresolved>
   5: 0x7ff71776131f - <unresolved>
   6: 0x7ff717745d1c - <unresolved>
   7: 0x7ffe65b77974 - BaseThreadInitThunk
   8: 0x7ffe67efa0b1 - RtlUserThreadStart"""

node中继功能?

服务器中转延迟比较大,能否让node A根据延迟选择其他nodeX来中继去往node B的数据?

address pool

please consider to add an ip address pool in the server.
when a fubuki client make a socket connection with a successful login to the fubuki server, the server pass a free ip address from the pool to the client for configure the tun.

{
"channel_limit": 100,
"tcp_heartbeat_interval_secs": 5,
"ip_pool": 192.168.1.0/24,
"listeners": [
{
"listen_addr": "0.0.0.0:12345",
"key": "a123"
}
]
}

使用了与请求的协议不兼容的地址。 (os error 10047)

[2023-09-16 16:16:22] INFO fubuki::node - node M1saka-Gaming-Laptop(10.100.0.11) has joined group misaka-network
[2023-09-16 16:16:22] INFO fubuki::node - group misaka-network address range 10.100.0.0/24
[2023-09-16 16:16:22] INFO fubuki::node - node M1saka-Gaming-Laptop update hosts
[2023-09-16 16:16:25] INFO fubuki::node - node M1saka-Gaming-Laptop update hosts
[2023-09-16 16:16:30] INFO fubuki::node - clear node M1saka-Gaming-Laptop host records
[2023-09-16 16:16:30] INFO fubuki::node - clear node M1saka-Gaming-Laptop nat list
node M1saka-Gaming-Laptop udp handler error

Caused by:
    使用了与请求的协议不兼容的地址。 (os error 10047)

node name

please consider auto-generating a random node_name or using the hostname of the device.
the final goal is to use the same conf.file for all nodes.
but also being able to pass parameters from the command line is a good thing so we can get rid of the node-config file altogether depending on use cases

Great work, keep it up!
Congratulations for the milestone version 0.50!

ERROR fubuki - Process error -> Failed to create UDP socket

fubuki client client-config.json
[2023-05-04 17:32:06] ERROR fubuki - Process error -> Failed to create UDP socket

Caused by:
在其上下文中,该请求的地址无效。 (os error 10049)

当前目录下有wintun.dll amd64 ,但是报这个是什么问题,试过两台电脑都一样

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.