Expand description
Easy to use Wireguard config generator.
- Use
InterfaceBuilder
andPeerBuilder
for interface/peers creation. - Use
Interface
’s andPeer
’sstd::fmt::Display
for exporting Wireguard config (.to_string()
,write!()
, etc). - Use
PrivateKey
andPublicKey
for generating, importing keys. - Use
AmneziaSettings
for generating/using AmneziaWG obfuscation values.
§Features
amneziawg
: Adds AmneziaWG obfuscation values support.
§Example
use wireguard_conf::prelude::*;
use wireguard_conf::as_ipnet;
use ipnet::Ipv4Net;
let peer = PeerBuilder::new()
.add_allowed_ip(as_ipnet!("10.0.0.2/24"))
.build();
let interface = InterfaceBuilder::new()
.address(as_ipnet!("10.0.0.1/24"))
.add_peer(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).unwrap());
Modules§
Macros§
- as_
ipnet - Get expression as
ipnet::Ipv4Net
Structs§
- Amnezia
Settings amneziawg
- AmneziaWG obfuscation values.
- Interface
- Struct, that represents complete configuration (contains both
[Interface]
and[Peer]
sections). - Interface
Builder - Builder, that used for creating
Interface
s. - Peer
- Struct, that represents
[Peer]
section in configuration. - Peer
Builder - Builder, that used for creating
Peer
s. - Private
Key - Private key
- Public
Key - Public key.
Enums§
- Table
- Controls the routing table to which routes are added.
- Wireguard
Error