Networks
Commands for managing libvirt virtual networks — listing, inspecting, creating, activating, deactivating, and deleting networks that VMs can attach to.
ls
List all libvirt networks managed by the daemon, showing name, UUID, active state, persistence, autostart, mode, bridge, subnet, and gateway.
vmr network lsExamples
vmr network lsinspect
Show detailed information about a specific network.
vmr network inspect <NAME>Arguments
| Argument | Description |
|---|---|
NAME | Name of the network to inspect |
Output Fields
| Field | Description |
|---|---|
Name | Network name |
UUID | Libvirt UUID |
Active | Whether the network is currently active |
Persistent | Whether the network persists across daemon restarts |
Autostart | Whether the network starts automatically on host boot |
Mode | Network mode (nat, isolated, routed, bridge, open, macvtap) |
Bridge | Host bridge interface name |
Subnet | Network subnet in CIDR notation |
Gateway | Gateway IP address |
DHCP Start | Start of the DHCP range |
DHCP End | End of the DHCP range |
Examples
vmr network inspect my-networkcreate
Create a new libvirt virtual network with the specified configuration.
vmr network create <NAME> [OPTIONS]Arguments
| Argument | Description |
|---|---|
NAME | Name for the new network |
Options
| Flag | Short | Description |
|---|---|---|
--mode <MODE> | -m | Network mode: nat, isolated, routed, bridge, open, or macvtap |
--subnet <CIDR> | -s | Subnet in CIDR notation (e.g., 192.168.100.0/24) |
--gateway <IP> | -g | Gateway IP address (e.g., 192.168.100.1) |
--dhcp-start <IP> | Start of the DHCP address range | |
--dhcp-end <IP> | End of the DHCP address range | |
--bridge <NAME> | -b | Host bridge interface name |
--autostart | -a | Automatically start the network on host boot |
Network Modes
| Mode | Description |
|---|---|
nat | NAT with host masquerade — guests can reach external networks through the host (default) |
isolated | Isolated network with no external connectivity — guests can only communicate with each other |
routed | Routed network with static routes — no NAT, requires external routing configuration |
bridge | Bridged to an existing host bridge interface — guests appear on the host's physical network |
open | Open/unrestricted forwarding — no firewall rules are applied |
macvtap | Direct attachment via macvtap to a host physical interface |
Examples
vmr network create my-nat-network \
--mode nat \
--subnet 192.168.100.0/24 \
--gateway 192.168.100.1 \
--dhcp-start 192.168.100.100 \
--dhcp-end 192.168.100.254
vmr network create my-isolated-network \
--mode isolated \
--subnet 10.10.0.0/24 \
--gateway 10.10.0.1 \
--autostart
vmr network create my-bridge-network \
--mode bridge \
--bridge br0TIP
For bridge mode, the host bridge interface must already exist. For macvtap mode, the parent device must be specified via the host configuration.
activate
Activate a previously defined but inactive network. VMs can only attach to active networks.
vmr network activate <NAME>Arguments
| Argument | Description |
|---|---|
NAME | Name of the network to activate |
Examples
vmr network activate my-networkdeactivate
Deactivate a running network. VMs currently attached to the network may lose connectivity.
vmr network deactivate <NAME>Arguments
| Argument | Description |
|---|---|
NAME | Name of the network to deactivate |
Examples
vmr network deactivate my-networkWARNING
Deactivating a network does not detach VMs that are currently using it. Running VMs attached to the network will lose their network interface connectivity. Stop or migrate affected VMs first.
remove
Delete a network definition. The network must be inactive unless --force is specified, in which case it is deactivated and then deleted.
vmr network remove <NAME> [OPTIONS]Arguments
| Argument | Description |
|---|---|
NAME | Name of the network to remove |
Options
| Flag | Short | Description |
|---|---|---|
--force | -f | Force removal — deactivate the network if it is currently active |
Examples
vmr network remove my-network
vmr network remove my-network -f