# `Hyper.Node.FireVMM.Net`
[🔗](https://github.com/harmont-dev/hyper/blob/main/lib/hyper/node/fire_vmm/net.ex#L1)

The per-VM *inner-world* networking contract. Every VM's netns is identical —
`tap0` at 172.30.0.1/30, guest at 172.30.0.2/30 — so a snapshot clone restores
a correct network with zero renumbering; host-side uniqueness is the helper's
job (see `Hyper.SuidHelper.Network`). This module owns the three values that
must agree between the guest kernel cmdline, the Firecracker NIC config, and
the helper: the guest MAC, the `ip=` autoconfig string, and the NIC spec.

# `guest_mac`

```elixir
@spec guest_mac(Hyper.Vm.Id.t()) :: String.t()
```

Stable locally-administered unicast MAC for `vm_id`. Derived from a SHA-256 of
the id so it is deterministic on any node (aids debugging); duplicate MACs are
harmless since no two guests ever share an L2 segment (each is alone in its netns).

# `interface`

```elixir
@spec interface(Hyper.Vm.Id.t()) :: Hyper.Firecracker.Api.NetworkInterface.t()
```

The Firecracker NIC spec for `vm_id` (guest `eth0` bound to in-netns `tap0`).

# `ip_cmdline`

```elixir
@spec ip_cmdline() :: String.t()
```

Kernel `ip=` autoconfig fragment appended to every networked VM's cmdline.

# `resolver_cmdline`

```elixir
@spec resolver_cmdline(String.t()) :: String.t()
```

Kernel `hyper.resolver=` cmdline fragment carrying the DNS resolver IP the
PID-1 guest agent writes to `/etc/resolv.conf` — kernel `ip=` autoconfig sets
the guest's address/route but never DNS, so this closes that gap. Pure:
callers (`BootSpec.resolve/2`) read the configured resolver themselves.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
