Firecracker.NetworkInterface (firecracker v0.1.0)

View Source

Configures network interfaces for a Firecracker virtual machine.

This module manages virtual network interfaces that connect the VM to the host network, allowing configuration of MAC addresses, rate limiting, and device naming.

Fields

  • :iface_id - Required. Unique identifier for the network interface
  • :host_dev_name - Required. Name of the network device on the host system
  • :guest_mac - Optional. MAC address for the interface within the guest VM
  • :rx_rate_limiter - Optional. Rate limiter for incoming network traffic
  • :tx_rate_limiter - Optional. Rate limiter for outgoing network traffic
  • :applied? - Internal flag indicating whether this configuration has been applied

Post-boot Behavior

The following fields can be modified after VM starts:

  • :iface_id - Required to identify which interface to modify
  • :rx_rate_limiter - Rate limiter for incoming traffic
  • :tx_rate_limiter - Rate limiter for outgoing traffic

Notes

  • Interface IDs must be unique within a VM configuration
  • The host device must exist before attaching it to the VM
  • Guest MAC addresses should be generated to avoid conflicts
  • Rate limiters help control network bandwidth usage
  • TAP devices are commonly used as the host network device

Summary

Types

t()

@type t() :: %Firecracker.NetworkInterface{
  applied?: boolean(),
  guest_mac: String.t() | nil,
  host_dev_name: String.t(),
  iface_id: String.t(),
  rx_rate_limiter: Firecracker.RateLimiter.t() | nil,
  tx_rate_limiter: Firecracker.RateLimiter.t() | nil
}