Skip to content

Virtual Networking

Cockpit gives your virtual machines network connectivity in two ways:

  • Host networks live on a single physical host and connect the VMs running there.
  • Distributed networks span every host in the cluster, so a VM keeps the same network no matter which host it runs on.

Choose host networks for workloads that stay on one host, and distributed networks when VMs need to move between hosts (live migration, High Availability, or a Kubernetes cluster spread across hosts).


Host networks

A host network is a virtual switch on one hypervisor. VMs attached to it can reach each other, the host, and — depending on the mode — the outside world.

Network modes

ModeWhat it doesTypical use
NATVMs share the host's IP for outbound traffic; incoming connections are blocked by default.General internet access for VMs without exposing them directly.
RoutedVM traffic is placed directly on the physical network, with no address translation.When VMs need their own addresses on your LAN (requires upstream routing).
Host-Only (Isolated)VMs talk only to each other and the host — no external access.Private, self-contained test networks.

Settings

  • Name — A label for the network.
  • IP Address & Netmask — The gateway address and subnet for the network (for example, 192.168.222.1 / 255.255.255.0).
  • DHCP Range — The pool of addresses handed out automatically to VMs (for example, 192.168.222.10192.168.222.50).
  • Autostart — Whether the network starts automatically when the host boots.

Managing a network

  • Start / Stop — Turn the virtual switch on or off. Stopping it disconnects every VM attached to it.
  • Edit — Change settings such as autostart.
  • Delete — Remove the network (it must be stopped first).

Monitoring

  • DHCP Leases — See which VMs currently hold which IP addresses, including their names and lease expiry.
  • Active Ports — See the live connections between the network and running VMs.

Distributed networks

A distributed network is defined once at the cluster level and automatically applied to every host. Because the network configuration is identical everywhere, a VM connected to it keeps working seamlessly when it moves — its network does not "disappear" when it migrates to another host.

Why use one

  • Live migration without interruption — A VM can move to another host and stay on the same network.
  • High Availability — When HA restarts a VM on a different host, it reconnects to the same network automatically.
  • Clusters across hosts — A Kubernetes cluster whose nodes are spread across hosts needs a network that reaches all of them; a distributed network provides exactly that.

Under the hood, Cockpit uses high-performance software switching (Open vSwitch, with a standard bridge as a fallback) and maps the network to the right physical adapter on each host. You do not need to configure each host by hand — Cockpit pushes the configuration out for you.

Creating a distributed network

When you create or edit a distributed network, Cockpit sends the configuration to all member hosts and reports how each one is doing. Watch the status while it settles:

StatusMeaning
SyncedThis host has created the network and is ready.
ActiveThe network is up and working on all hosts.
PartialIt worked on some hosts but not others — this one needs attention.
ErrorThe network could not be applied across the cluster.

If you see Partial or Error, check the affected host (for example, that the mapped physical adapter exists and is connected), then retry.

Deleting a distributed network safely

Cockpit protects you from cutting off running VMs. If any VM is still using a distributed network, deletion is blocked with a message telling you which VMs depend on it.

To delete it, first move those VMs to a different network (or remove the VMs), then delete the distributed network.

TIP

This safety check is why a "Cannot delete: in use by virtual machines" message is a feature, not an error — it is preventing accidental loss of connectivity. Detach the listed VMs first.