lxc-network
manages networks for LXD containers and VMs
TLDR
SYNOPSIS
lxc network subcommand [[remote:]network] [args] [options]
DESCRIPTION
lxc network manages networks for LXD containers and virtual machines. Managed network types include bridge (default), macvlan, sriov, ovn and physical. It can create and configure networks, attach them to instances or profiles, and inspect leases and allocations.Configuration keys such as ipv4.address, ipv4.nat, ipv4.dhcp, ipv6.address, dns.domain and bridge.mtu are set at creation time or later with set.
PARAMETERS
--target member
Cluster member to act on (for create, get, set, show, info and others).-p, --property
With get, set or unset: treat the key as a network property (such as description) rather than a config key.
SUBCOMMANDS
list [remote:]
List available networks. Supports --format (csv, json, table, yaml, compact) and --all-projects.show network
Show network configuration as YAML.info network
Show runtime information (addresses, traffic counters, bond/VLAN state).create network [key=value...]
Create a new managed network. --type/-t sets the network type.delete network
Delete a network.rename network new-name
Rename a network.edit network
Edit the network configuration as YAML.get network key
Get a configuration value.set network key=value...
Set configuration values.unset network key
Remove a configuration key.attach network instance [device] [interface]
Attach a network interface to an instance.detach network instance [device]
Detach a network interface from an instance.attach-profile / detach-profile network profile [device]
Attach or detach a network interface to/from a profile.list-leases network
List DHCP leases.list-allocations
List IP addresses in use across networks and instances.acl, forward, load-balancer, peer, zone
Manage network ACLs, address forwards, load balancers, OVN peerings and DNS zones.
CAVEATS
Only managed networks can be configured; unmanaged host interfaces appear in the list but cannot be edited. Changing ipv4.address on a bridge in use disrupts connected instances. In Incus, the community fork of LXD, the same functionality is provided by incus network, and the separate LXC tools (lxc-start etc.) have no lxc-network command.
HISTORY
Managed networks and the lxc network command were introduced in LXD 2.3 (2016). Since 2023 LXD is developed by Canonical, while the Linux Containers community continues the codebase as Incus.
