# `Tank.Runtime.Network`
[🔗](https://github.com/oshlabs/tank/blob/v0.2.0/lib/tank/runtime/network.ex#L1)

Configures a pod's network namespace at the `Linx.Process` `:ready`
checkpoint. A pod's `:network` is one of:

  * `:host` — the workload shares the host's network namespace (the runtime
    simply doesn't give it a fresh `:net` ns), so there is nothing to do here.
  * `:none` — an isolated netns with loopback only.
  * `%Tank.Pod.Network{}` — loopback plus one or more `%Tank.Nic{}`.

Each macvlan NIC is **created in the host netns over its parent uplink, then
moved into the container's netns**, and renamed / addressed / brought up
there — a macvlan can't be created directly in the container over a parent
that lives in the host netns. The host-side name is transient because the
final name (e.g. `eth0`) usually collides with a host interface.

DNS (`/etc/resolv.conf`) is materialised by the orchestrator (`Tank.Runtime`)
during rootfs setup, not here.

# `setup`

```elixir
@spec setup(pos_integer(), Tank.Pod.Network.t() | :host | :none) ::
  :ok | {:error, term()}
```

Configure the netns of the container parked at `host_pid`.

---

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