百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
W

wireguard-rs

> 编程语言
开源

Rust 库为本地/内核和用户空间执行提供统一的线导接口

329 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

Rust 库为本地/内核和用户空间执行提供统一的线导接口

defguard_wireguard_rs is a multi-platform Rust library providing a unified high-level API for managing WireGuard interfaces using native OS kernel and userspace WireGuard protocol implementations. It can be used to create your own WireGuard:tm: VPN servers or clients for secure and private networking.

It was developed as part of defguard security platform and used in the gateway/server as well as desktop client.

Supported platforms

  • Native OS Kernel: Linux, FreeBSD (and pfSense/OPNSense), NetBSD, Windows
  • Userspace: Linux, macOS, FreeBSD, NetBSD

Unique features

  • Peer routing - see WGApi docs.
  • Configuring DNS resolver - see WGApi docs.
    • On FreeBSD network interfaces are managed using ioctl.
    • On Linux, handle network routing using netlink.
    • fwmark handling

Windows support

Please note that WireGuard-NT dll file has to be placed under resources-windows/binaries/wireguard.dll path relative to your binary.

Windows development

For Windows development you'll need:

  1. The stable-x86_64-pc-windows-gnu Rust toolchain. Use rustup to change the toolchain:
rustup install stable-x86_64-pc-windows-gnu
rustup default stable-x86_64-pc-windows-gnu
  1. Install MSYS2

  2. Then run this in the MSYS2 terminal:

pacman -S --needed base-devel mingw-w64-ucrt-x86_64-toolchain mingw-w64-ucrt-x86_64-nasm
  1. Finally add msys to your PATH:
# cmd
set PATH=C:\msys64\\ucrt64\bin;%PATH%
# power-shell
$env:PATH = "C:\msys64\\ucrt64\bin;" + $env:PATH

More info can be found here.

Examples

  • Client: https://github.com/DefGuard/wireguard-rs/blob/main/examples/client.rs
  • Server: https://github.com/DefGuard/wireguard-rs/blob/main/examples/server.rs

Documentation

See the documentation for more information.

Community and Support

Reach out to our community via GitHub Discussions

Contribution

Please review the Contributing guide for information on how to get started contributing to the project. You might also find our environment setup guide handy.

Legal

WireGuard® is registered trademarks of Jason A. Donenfeld.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rustcratecrateslibrarylinux

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言