pub struct GuestNetworkConfig {
pub guest_ip: Ipv4Addr,
pub gateway_ip: Ipv4Addr,
pub prefix_len: u8,
pub guest_ip6: Ipv6Addr,
pub gateway_ip6: Ipv6Addr,
pub prefix_len6: u8,
pub guest_mac: [u8; 6],
pub gateway_mac: [u8; 6],
pub dns_server: Ipv4Addr,
pub upstream_dns: Ipv4Addr,
}Expand description
Static guest network configuration for the virtio-net MVP.
This struct describes the two endpoints of the single virtual Ethernet link:
- the guest NIC (
guest_*) - the host-side gateway implemented by smolvm (
gateway_*)
The link is dual-stack: a /30 IPv4 point-to-point pair and a /64 ULA IPv6
pair (fd53:4d00::/64 — 53:4d = “SM”, matching the MAC OUI scheme).
Fields§
§guest_ip: Ipv4AddrGuest IPv4 address.
gateway_ip: Ipv4AddrGateway IPv4 address.
prefix_len: u8Prefix length.
guest_ip6: Ipv6AddrGuest IPv6 (ULA) address.
gateway_ip6: Ipv6AddrGateway IPv6 (ULA) address.
prefix_len6: u8IPv6 prefix length.
guest_mac: [u8; 6]Guest MAC address.
gateway_mac: [u8; 6]Gateway MAC address.
dns_server: Ipv4AddrDNS server address presented to the guest.
For virtio-net this is the gateway’s own address (gateway_ip): the
guest sends DNS to the gateway, which forwards upstream to
Self::upstream_dns.
upstream_dns: Ipv4AddrUpstream resolver the gateway forwards guest DNS queries to.
Defaults to DEFAULT_DNS_ADDR; the launcher overrides it when the
caller passes --dns <ip> so a VM on a network that blocks the default
resolver can still resolve names.
Implementations§
Trait Implementations§
Source§impl Clone for GuestNetworkConfig
impl Clone for GuestNetworkConfig
Source§fn clone(&self) -> GuestNetworkConfig
fn clone(&self) -> GuestNetworkConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more