Product SiteDocumentation Site

2.66. net-undefine

Removes an inactive virtual network from the libvirt configuration.
Usage
net-undefine --network network-identifier
Options
Name Required? Description
--network network-identifier
required
The name or UUID of the virtual network to remove.
The word "--network" itself is optional.
Table 2.12. Options

Availability
Available from libvirt 0.2.0 onwards
Platform or Hypervisor specific notes
None yet
Examples
virsh # net-undefine examplenetwork
Undefines the virtual network named "examplenetwork".
virsh # net-undefine --network examplenetwork
Same as the above example.
virsh # net-undefine b7005dec-be1a-fe9a-338a-0cb1301dfcfd
Undefines the virtual network having a UUID of "b7005dec-be1a-fe9a-338a-0cb1301dfcfd".
virsh # net-undefine --network b7005dec-be1a-fe9a-338a-0cb1301dfcfd
Same as the above example.
Example in context
Starting with a virtual network named examplenetwork, already running on a virtualisation host server:
virsh # net-list
Name                 State      Autostart
-----------------------------------------
default              active     yes
examplenetwork       active     yes
The virtual network is running (active), so we need to shut it down before removing it. We use the net-destroy command to shut it down:
# net-destroy examplenetwork
Network examplenetwork destroyed
Then remove it using net-undefine:
virsh # net-undefine examplenetwork       <-- this is net-undefine in action
Network examplenetwork has been undefined
Done. The net-list command no longer shows it listed:
virsh # net-list --all
Name                 State      Autostart
-----------------------------------------
default              active     yes
See also
  • net-define - Adds a new persistent virtual network to libvirt, without starting it, using settings from an XML file.
  • net-destroy - Shuts down a running virtual network, as started with net-create or net-start.
  • net-list - Displays a list of the virtual networks libvirt is aware of.