Expand description
Easy to use Wireguard config generator.
- Use
InterfaceBuilderandPeerBuilderfor interface/peers creation. - Use
Interface’s andPeer’sstd::fmt::Displayfor exporting Wireguard config (.to_string(),write!(), etc). - Use
PrivateKey,PublicKeyandPresharedKeyfor generating, importing and exporting keys. - Use
AmneziaWGto generate and use AmneziaWG obfuscation values.
§Features
-
amneziawg: adds support for generating and manually building amnezia settings viaAmneziaWGenum.AmneziaWG is a fork of wireguard, that less recognizable by DPI systems by randomizing packet headers with packet sizes.
-
serde: adds implementions ofserde::Serializeandserde::Deserializefor all structs.
§Example
use wireguard_conf::prelude::*;
use wireguard_conf::as_ipnet;
let peer = Peer::builder()
.allowed_ips([as_ipnet!("10.0.0.2/24")])
.build();
let interface = Interface::builder()
.address([as_ipnet!("10.0.0.1/24")])
.peers([peer.clone()])
.build();
// to export configs, use `println!()`, `writeln!()`, `.to_string()`, etc.
println!("Server's config:");
println!("{}\n", interface);
println!("Client's config:");
println!("{}", peer.to_interface(&interface, ToInterfaceOptions::new()).unwrap());Re-exports§
pub use ipnet;
Modules§
- prelude
- Re-exports of common structs.
Macros§
- as_
ipaddr - Get expression as
std::net::IpAddr - as_
ipnet - Get expression as
ipnet::IpNet
Structs§
- AmneziaW
G1 amneziawg - AmneziaWG 1.0 obfuscation values.
- AmneziaW
G2 amneziawg - AmneziaWG 2.0 obfuscation values.
- AmneziaW
G2Builder amneziawg - Builder for
AmneziaWG2. - HRange
amneziawg - Inclusive range of H values used by AmneziaWG 2.0.
- Interface
- Struct, that represents complete configuration (contains both
[Interface]and[Peer]sections). - Interface
Builder - Builder for
Interface. - Peer
- Struct, that represents
[Peer]section in configuration. - Peer
Builder - Builder for
Peer. - Preshared
Key - Preshared key.
- Private
Key - Private key
- Public
Key - Public key.
- ToInterface
Options - Options for
Peer::to_interface().
Enums§
- AmneziaWG
amneziawg - AmneziaWG obfuscation values. By using this enum, you can parse, generate and validate for all AmneziaWG versions.
- Table
- Controls the routing table to which routes are added.
- Wireguard
Error wireguard-conferror.
Type Aliases§
- Wireguard
Result - Result alias.