Struct CommonPropertiesAllDevices

Source
pub struct CommonPropertiesAllDevices {
Show 25 fields pub renderer: Option<Renderer>, pub dhcp4: Option<bool>, pub dhcp6: Option<bool>, pub ipv6_mtu: Option<u16>, pub ipv6_privacy: Option<bool>, pub link_local: Option<Vec<String>>, pub ignore_carrier: Option<bool>, pub critical: Option<bool>, pub dhcp_identifier: Option<String>, pub dhcp4_overrides: Option<DhcpOverrides>, pub dhcp6_overrides: Option<DhcpOverrides>, pub accept_ra: Option<bool>, pub addresses: Option<Vec<AddressMapping>>, pub ipv6_address_generation: Option<Ipv6AddressGeneration>, pub ipv6_address_token: Option<String>, pub gateway4: Option<String>, pub gateway6: Option<String>, pub nameservers: Option<NameserverConfig>, pub macaddress: Option<String>, pub mtu: Option<u16>, pub optional: Option<bool>, pub optional_addresses: Option<Vec<String>>, pub activation_mode: Option<ActivationMode>, pub routes: Option<Vec<RoutingConfig>>, pub routing_policy: Option<Vec<RoutingPolicy>>,
}

Fields§

§renderer: Option<Renderer>

Use the given networking backend for this definition. Currently supported are networkd and NetworkManager. This property can be specified globally in network:, for a device type (in e. g. ethernets:) or for a particular device definition. Default is networkd.

(Since 0.99) The renderer property has one additional acceptable value for vlan objects (i. e. defined in vlans:): sriov. If a vlan is defined with the sriov renderer for an SR-IOV Virtual Function interface, this causes netplan to set up a hardware VLAN filter for it. There can be only one defined per VF.

§dhcp4: Option<bool>

Enable DHCP for IPv4. Off by default.

§dhcp6: Option<bool>

Enable DHCP for IPv6. Off by default. This covers both stateless DHCP - where the DHCP server supplies information like DNS nameservers but not the IP address - and stateful DHCP, where the server provides both the address and the other information.

If you are in an IPv6-only environment with completely stateless autoconfiguration (SLAAC with RDNSS), this option can be set to cause the interface to be brought up. (Setting accept-ra alone is not sufficient.) Autoconfiguration will still honour the contents of the router advertisement and only use DHCP if requested in the RA.

Note that rdnssd(8) is required to use RDNSS with networkd. No extra software is required for NetworkManager.

§ipv6_mtu: Option<u16>

Set the IPv6 MTU (only supported with networkd backend). Note that needing to set this is an unusual requirement.

§ipv6_privacy: Option<bool>

Enable IPv6 Privacy Extensions (RFC 4941) for the specified interface, and prefer temporary addresses. Defaults to false - no privacy extensions. There is currently no way to have a private address but prefer the public address.

§link_local: Option<Vec<String>>

Configure the link-local addresses to bring up. Valid options are ‘ipv4’ and ‘ipv6’, which respectively allow enabling IPv4 and IPv6 link local addressing. If this field is not defined, the default is to enable only IPv6 link-local addresses. If the field is defined but configured as an empty set, IPv6 link-local addresses are disabled as well as IPv4 link- local addresses.

This feature enables or disables link-local addresses for a protocol, but the actual implementation differs per backend. On networkd, this directly changes the behavior and may add an extra address on an interface. When using the NetworkManager backend, enabling link-local has no effect if the interface also has DHCP enabled.

Example to enable only IPv4 link-local: link-local: [ ipv4 ] Example to enable all link-local addresses: link-local: [ ipv4, ipv6 ] Example to disable all link-local addresses: link-local: [ ]

§ignore_carrier: Option<bool>

(networkd backend only) Allow the specified interface to be configured even if it has no carrier.

§critical: Option<bool>

Designate the connection as “critical to the system”, meaning that special care will be taken by to not release the assigned IP when the daemon is restarted. (not recognized by NetworkManager)

§dhcp_identifier: Option<String>

(networkd backend only) Sets the source of DHCPv4 client identifier. If mac is specified, the MAC address of the link is used. If this option is omitted, or if duid is specified, networkd will generate an RFC4361-compliant client identifier for the interface by combining the link’s IAID and DUID.

§dhcp4_overrides: Option<DhcpOverrides>

(networkd backend only) Overrides default DHCP behavior

§dhcp6_overrides: Option<DhcpOverrides>

(networkd backend only) Overrides default DHCP behavior

§accept_ra: Option<bool>

Accept Router Advertisement that would have the kernel configure IPv6 by itself. When enabled, accept Router Advertisements. When disabled, do not respond to Router Advertisements. If unset use the host kernel default setting.

§addresses: Option<Vec<AddressMapping>>

Add static addresses to the interface in addition to the ones received through DHCP or RA. Each sequence entry is in CIDR notation, i. e. of the form addr/prefixlen. addr is an IPv4 or IPv6 address as recognized by inet_pton(3) and prefixlen the number of bits of the subnet.

For virtual devices (bridges, bonds, vlan) if there is no address configured and DHCP is disabled, the interface may still be brought online, but will not be addressable from the network.

§ipv6_address_generation: Option<Ipv6AddressGeneration>

Configure method for creating the address for use with RFC4862 IPv6 Stateless Address Autoconfiguration (only supported with NetworkManager backend). Possible values are eui64 or stable-privacy.

§ipv6_address_token: Option<String>

Define an IPv6 address token for creating a static interface identifier for IPv6 Stateless Address Autoconfiguration. This is mutually exclusive with ipv6-address-generation.

§gateway4: Option<String>

Deprecated, see Default routes. Set default gateway for IPv4/6, for manual address configuration. This requires setting addresses too. Gateway IPs must be in a form recognized by inet_pton(3). There should only be a single gateway per IP address family set in your global config, to make it unambiguous. If you need multiple default routes, please define them via routing-policy.

§gateway6: Option<String>

Deprecated, see Default routes. Set default gateway for IPv4/6, for manual address configuration. This requires setting addresses too. Gateway IPs must be in a form recognized by inet_pton(3). There should only be a single gateway per IP address family set in your global config, to make it unambiguous. If you need multiple default routes, please define them via routing-policy.

§nameservers: Option<NameserverConfig>

Set DNS servers and search domains, for manual address configuration.

§macaddress: Option<String>

Set the device’s MAC address. The MAC address must be in the form “XX:XX:XX:XX:XX:XX”.

Note: This will not work reliably for devices matched by name only and rendered by networkd, due to interactions with device renaming in udev. Match devices by MAC when setting MAC addresses.

§mtu: Option<u16>

Set the Maximum Transmission Unit for the interface. The default is 1500. Valid values depend on your network interface.

Note: This will not work reliably for devices matched by name only and rendered by networkd, due to interactions with device renaming in udev. Match devices by MAC when setting MTU.

§optional: Option<bool>

An optional device is not required for booting. Normally, networkd will wait some time for device to become configured before proceeding with booting. However, if a device is marked as optional, networkd will not wait for it. This is only supported by networkd, and the default is false.

§optional_addresses: Option<Vec<String>>

Specify types of addresses that are not required for a device to be considered online. This changes the behavior of backends at boot time to avoid waiting for addresses that are marked optional, and thus consider the interface as “usable” sooner. This does not disable these addresses, which will be brought up anyway.

§activation_mode: Option<ActivationMode>

Allows specifying the management policy of the selected interface. By default, netplan brings up any configured interface if possible. Using the activation-mode setting users can override that behavior by either specifying manual, to hand over control over the interface state to the administrator or (for networkd backend only) off to force the link in a down state at all times. Any interface with activation-mode defined is implicitly considered optional. Supported officially as of networkd v248+.

§routes: Option<Vec<RoutingConfig>>

Configure static routing for the device

§routing_policy: Option<Vec<RoutingPolicy>>

Configure policy routing for the device

Trait Implementations§

Source§

impl Clone for CommonPropertiesAllDevices

Source§

fn clone(&self) -> CommonPropertiesAllDevices

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CommonPropertiesAllDevices

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CommonPropertiesAllDevices

Source§

fn default() -> CommonPropertiesAllDevices

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

impl<'de> Deserialize<'de> for CommonPropertiesAllDevices

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for CommonPropertiesAllDevices

Source§

fn eq(&self, other: &CommonPropertiesAllDevices) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for CommonPropertiesAllDevices

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for CommonPropertiesAllDevices

Source§

impl StructuralPartialEq for CommonPropertiesAllDevices

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,