Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/defguard/wireguard-rs
Rust library providing unified WireGuard interface to native/kernel and userspace implementations
https://github.com/defguard/wireguard-rs
crate crates library linux networking openvpn rust rust-lang vpn wireguard wireguard-server wireguard-vpn
Last synced: 2 days ago
JSON representation
Rust library providing unified WireGuard interface to native/kernel and userspace implementations
- Host: GitHub
- URL: https://github.com/defguard/wireguard-rs
- Owner: DefGuard
- License: other
- Created: 2023-08-24T10:11:07.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-18T16:10:50.000Z (2 months ago)
- Last Synced: 2024-10-29T22:32:37.133Z (about 2 months ago)
- Topics: crate, crates, library, linux, networking, openvpn, rust, rust-lang, vpn, wireguard, wireguard-server, wireguard-vpn
- Language: Rust
- Homepage: https://github.com/defguard/defguard/
- Size: 281 KB
- Stars: 155
- Watchers: 6
- Forks: 15
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
**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:](https://www.wireguard.com/) VPN servers or clients for secure and private networking.It was developed as part of [defguard](https://github.com/defguard/defguard) security platform and used in the [gateway/server](https://github.com/defguard/gateway) as well as [desktop client](https://github.com/defguard/client).
## Supported platforms
* **Native OS Kernel**: Linux, FreeBSD (and pfSense/OPNSense), Windows
* Userspace using [wireguard-go](https://github.com/WireGuard/wireguard-go) - Linux, **macOS**, FreeBSD### Unique features
* **Peer routing** - see [WGApi](https://docs.rs/defguard_wireguard_rs/latest/defguard_wireguard_rs/struct.WGApi.html) docs.
* Configuring **DNS resolver** - see [WGApi](https://docs.rs/defguard_wireguard_rs/latest/defguard_wireguard_rs/struct.WGApi.html) docs.
* On FreeBSD network interfaces are managed using **ioctl**.
* On Linux, handle network routing using **netlink**.
* **fwmark** handling### Windows support
Please note that [WireGuard](https://www.wireguard.com/install/) needs to be installed on Windows with commands `wg` and `wireguard` available to be called from the command line.### Note on `wireguard-go`
If you intend to use the userspace WireGuard implementation you should note that currently the library assumes
that the `wireguard-go` binary will be available at runtime. There are some sanity checks when instantiating the API,
but installing it is outside the scope of this project.## 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](https://defguard.gitbook.io) for more information.
## Community and Support
Find us on Matrix: [#defguard:teonite.com](https://matrix.to/#/#defguard:teonite.com)
## Contribution
Please review the [Contributing guide](https://defguard.gitbook.io/defguard/for-developers/contributing) for information on how to get started contributing to the project. You might also find our [environment setup guide](https://defguard.gitbook.io/defguard/for-developers/dev-env-setup) handy.
# Built and sponsored by
# Legal
WireGuard® is [registered trademarks](https://www.wireguard.com/trademark-policy/) of Jason A. Donenfeld.