pub struct OverlayConfig {
pub local_endpoint: SocketAddr,
pub private_key: String,
pub public_key: String,
pub overlay_cidr: String,
pub cluster_cidr: Option<String>,
pub peer_discovery_interval: Duration,
pub uapi_sock_dir: PathBuf,
pub mtu: u32,
}Expand description
Overlay network configuration
Fields§
§local_endpoint: SocketAddrLocal overlay endpoint (WireGuard protocol)
private_key: StringPrivate key (x25519)
public_key: StringPublic key (derived from private key)
overlay_cidr: StringOverlay network CIDR (supports both IPv4 e.g. “10.0.0.0/8” and IPv6 e.g. “fd00::/48”)
Historically stores the per-node slice / host IP (e.g. 10.200.0.0/28
or 10.200.0.1/32) that the local TUN/Wintun adapter is assigned.
It is not the full cluster CIDR — use Self::cluster_cidr for that.
cluster_cidr: Option<String>Full cluster CIDR (e.g. 10.200.0.0/16).
Used on Windows to install a catch-all host route pointing the
entire cluster range at the Wintun adapter so traffic to remote-node
container IPs flows through the overlay (HCN auto-installs the more
specific local /28 → vSwitch route, and longest-prefix-match routes
local traffic to the vSwitch). None on pre-cluster-CIDR configs;
callers should fall back to skipping the route install in that case.
peer_discovery_interval: DurationPeer discovery interval
uapi_sock_dir: PathBufDirectory containing per-interface WireGuard UAPI sockets
(<dir>/<interface_name>.sock). Defaults to /var/run/wireguard
on Linux for wg(8) interop; overridden to {data_dir}/run/wireguard
by the daemon when running with a non-default --data-dir to keep
a test/dev daemon hermetic.
mtu: u32MTU applied to the overlay tunnel interface.
Defaults to 1420: the standard WireGuard tunnel MTU (1500-byte
underlay MTU minus 80 bytes of WireGuard encapsulation overhead).
Matches the Windows Wintun default in transport.rs.
Applied to the TUN interface on Linux/macOS at configure time. On
Windows, Wintun exposes no per-adapter MTU setter, so this value is
advisory there (IP Helper may override it). Lowering it matters when
running WireGuard-in-WireGuard — e.g. the overlay riding over
another mesh such as netbird — where stacked encapsulation shrinks
the usable payload and an over-large MTU causes silent blackholing
of oversized packets that can’t be fragmented.
Trait Implementations§
Source§impl Clone for OverlayConfig
impl Clone for OverlayConfig
Source§fn clone(&self) -> OverlayConfig
fn clone(&self) -> OverlayConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OverlayConfig
impl Debug for OverlayConfig
Source§impl Default for OverlayConfig
impl Default for OverlayConfig
Source§impl<'de> Deserialize<'de> for OverlayConfig
impl<'de> Deserialize<'de> for OverlayConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for OverlayConfig
impl PartialEq for OverlayConfig
Source§fn eq(&self, other: &OverlayConfig) -> bool
fn eq(&self, other: &OverlayConfig) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for OverlayConfig
impl Serialize for OverlayConfig
impl StructuralPartialEq for OverlayConfig
Auto Trait Implementations§
impl Freeze for OverlayConfig
impl RefUnwindSafe for OverlayConfig
impl Send for OverlayConfig
impl Sync for OverlayConfig
impl Unpin for OverlayConfig
impl UnsafeUnpin for OverlayConfig
impl UnwindSafe for OverlayConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FromBase64 for Twhere
T: for<'de> Deserialize<'de>,
impl<T> FromBase64 for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more