# `Tank.Nic`
[🔗](https://github.com/oshlabs/tank/blob/v0.2.0/lib/tank/nic.ex#L1)

One network interface inside a pod's network namespace.

  * `mode` — `:macvlan` (v1); `:bridge` / `:ipvlan` are modelled for later.
  * `parent` — the host uplink to attach to, or `:auto` to resolve it via
    `Tank.Host`.
  * `ip` — `{address, prefix}` for a static address (v1), or `:dhcp` (later).
  * `gateway` — optional default-route next hop for this NIC.

Loopback is always raised by the runtime and is not listed here.

# `ip`

```elixir
@type ip() :: {String.t(), 0..32} | :dhcp
```

# `t`

```elixir
@type t() :: %Tank.Nic{
  gateway: String.t() | nil,
  ip: ip(),
  mode: :macvlan | :bridge | :ipvlan,
  name: String.t(),
  parent: String.t() | :auto
}
```

# `new`

```elixir
@spec new(map() | keyword()) :: {:ok, t()} | {:error, term()}
```

Build a validated NIC from a map or keyword list.

# `new!`

```elixir
@spec new!(map() | keyword()) :: t()
```

Like `new/1` but raises `ArgumentError` on invalid input.

---

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