#[non_exhaustive]pub struct InterfaceIpv4 {Show 13 fields
pub enabled: bool,
pub dhcp: Option<bool>,
pub dhcp_client_id: Option<Dhcpv4ClientId>,
pub addresses: Option<Vec<InterfaceIpAddr>>,
pub forwarding: Option<bool>,
pub auto_dns: Option<bool>,
pub auto_gateway: Option<bool>,
pub auto_routes: Option<bool>,
pub auto_table_id: Option<u32>,
pub allow_extra_address: Option<bool>,
pub auto_route_metric: Option<u32>,
pub dhcp_send_hostname: Option<bool>,
pub dhcp_custom_hostname: Option<String>,
/* private fields */
}Expand description
IPv4 configuration of interface. Example YAML output of interface holding static IPv4:
---
interfaces:
- name: eth1
state: up
mtu: 1500
ipv4:
address:
- ip: 192.0.2.252
prefix-length: 24
- ip: 192.0.2.251
prefix-length: 24
dhcp: false
enabled: trueFields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.enabled: boolWhether IPv4 stack is enabled. When set to false, all IPv4 address will be removed from this interface.
dhcp: Option<bool>Whether DHCPv4 is enabled.
dhcp_client_id: Option<Dhcpv4ClientId>DHCPv4 client ID.
Serialize and deserialize to/from dhcp-client-id.
addresses: Option<Vec<InterfaceIpAddr>>IPv4 addresses.
When applying with None, current IP address will be preserved.
When applying with Some(Vec::new()), all IP address will be removed.
When switch from DHCP on to off with addresses set to None or all
addresses are dynamic, nmstate will convert current dynamic IP
address to static.
The IP addresses will apply to kernel with the same order specified
which result the IP addresses after first one holding the secondary
flag.
forwarding: Option<bool>Whether per‐interface IPv4 sysctl forwarding is enabled.
auto_dns: Option<bool>Whether to apply DNS resolver information retrieved from DHCP server.
Serialize and deserialize to/from auto-dns.
If you want to append static DNS name server before DHCP provided
servers, please set auto-dns: true explicitly a along with static
DNS server.
auto_gateway: Option<bool>Whether to set default gateway retrieved from DHCP server.
Serialize and deserialize to/from auto-gateway.
auto_routes: Option<bool>Whether to set routes(including default gateway) retrieved from DHCP
server.
Serialize and deserialize to/from auto-routes.
auto_table_id: Option<u32>The route table ID used to hold routes(including default gateway)
retrieved from DHCP server.
If not defined, the main(254) will be used.
Serialize and deserialize to/from auto-table-id.
allow_extra_address: Option<bool>If not defined or set to true, nmstate verification process
allows extra IP address found as long as desired IP address matched.
When set to false, the verification process of nmstate do exact equal
check on IP address.
Serialize/deserialize to/from allow-extra-address
auto_route_metric: Option<u32>Metric for routes retrieved from DHCP server.
Only available for DHCPv4 enabled interface.
Deserialize from auto-route-metric
dhcp_send_hostname: Option<bool>Whether to include hostname in DHCP request.
If the hostname is FQDN, the Fully Qualified Domain Name (FQDN)
option(81) defined in RFC 4702 will be used.
If the hostname is not FQDN, the Host Name option(12) defined in RFC
2132 will be used.
If not defined, set to True when DHCPv4 enabled.
Deserialize from dhcp-send-hostname
dhcp_custom_hostname: Option<String>Custom string to override hostname used for DHCP request.
If the hostname is FQDN, the Fully Qualified Domain Name (FQDN)
option(81) defined in RFC 4702 will be used.
If the hostname is not FQDN, the Host Name option(12) defined in RFC
2132 will be used.
If not defined, current non-dynamic hostname will be used.
Deserialize from dhcp-custom-hostname
Implementations§
Source§impl InterfaceIpv4
impl InterfaceIpv4
Trait Implementations§
Source§impl Clone for InterfaceIpv4
impl Clone for InterfaceIpv4
Source§fn clone(&self) -> InterfaceIpv4
fn clone(&self) -> InterfaceIpv4
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InterfaceIpv4
impl Debug for InterfaceIpv4
Source§impl Default for InterfaceIpv4
impl Default for InterfaceIpv4
Source§fn default() -> InterfaceIpv4
fn default() -> InterfaceIpv4
Source§impl<'de> Deserialize<'de> for InterfaceIpv4
impl<'de> Deserialize<'de> for InterfaceIpv4
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 InterfaceIpv4
impl PartialEq for InterfaceIpv4
Source§impl Serialize for InterfaceIpv4
impl Serialize for InterfaceIpv4
impl Eq for InterfaceIpv4
impl StructuralPartialEq for InterfaceIpv4
Auto Trait Implementations§
impl Freeze for InterfaceIpv4
impl RefUnwindSafe for InterfaceIpv4
impl Send for InterfaceIpv4
impl Sync for InterfaceIpv4
impl Unpin for InterfaceIpv4
impl UnwindSafe for InterfaceIpv4
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.