pub struct TunnelConfig {
    pub mode: Option<TunnelMode>,
    pub local: Option<String>,
    pub remote: Option<String>,
    pub ttl: Option<u64>,
    pub key: Option<TunnelKey>,
    pub mark: Option<String>,
    pub port: Option<String>,
    pub peers: Vec<WireGuardPeer>,
    pub common_all: Option<CommonPropertiesAllDevices>,
}
Expand description

Tunnels allow traffic to pass as if it was between systems on the same local network, although systems may be far from each other but reachable via the Internet. They may be used to support IPv6 traffic on a network where the ISP does not provide the service, or to extend and “connect” separate local networks. Please see https://en.wikipedia.org/wiki/Tunneling_protocol for more general information about tunnels.

Fields

mode: Option<TunnelMode>

Defines the tunnel mode. Valid options are sit, gre, ip6gre, ipip, ipip6, ip6ip6, vti, vti6 and wireguard. Additionally, the networkd backend also supports gretap and ip6gretap modes. In addition, the NetworkManager backend supports isatap tunnels.

local: Option<String>

Defines the address of the local endpoint of the tunnel.

remote: Option<String>

Defines the address of the remote endpoint of the tunnel.

ttl: Option<u64>

Defines the TTL of the tunnel.

key: Option<TunnelKey>

Define keys to use for the tunnel. The key can be a number or a dotted quad (an IPv4 address). For wireguard it can be a base64-encoded private key or (as of networkd v242+) an absolute path to a file, containing the private key (since 0.100). It is used for identification of IP transforms. This is only required for vti and vti6 when using the networkd backend, and for gre or ip6gre tunnels when using the NetworkManager backend.

This field may be used as a scalar (meaning that a single key is specified and to be used for input, output and private key), or as a mapping, where you can further specify input/output/private.

mark: Option<String>

Firewall mark for outgoing WireGuard packets from this interface, optional.

port: Option<String>

UDP port to listen at or auto. Optional, defaults to auto.

peers: Vec<WireGuardPeer>

A list of peers

common_all: Option<CommonPropertiesAllDevices>

Common properties for all devices

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.