bsdkrun/networks

Global networks — put machines on a shared subnet so they can reach each other by name.

Names resolve on Linux and FreeBSD via the network’s DNS; NetBSD resolves via a synced /etc/hosts block. Joins auto-sync, and sync refreshes an existing network without restarting its members.

Values

pub fn connect(
  machine: String,
  network: String,
) -> Result(Nil, error.Error)

Join machine to network. Applies on the machine’s next start.

pub fn create(name: String) -> Result(Nil, error.Error)

Create a global network.

pub fn disconnect(machine: String) -> Result(Nil, error.Error)

Detach machine from its network. Applies on its next start.

pub fn list() -> Result(List(types.NetworkInfo), error.Error)

List global networks.

pub fn members(
  network: String,
) -> Result(List(types.SandboxInfo), error.Error)

The machines currently attached to network, running or stopped.

pub fn remove(
  names: List(String),
  force: Bool,
) -> Result(Nil, error.Error)

Remove one or more networks. force removes them even with members attached.

pub fn sync(network: String) -> Result(Nil, error.Error)

Re-push name resolution to every member of network, without restarting them.

Search Document