libvirt – konfiguracja i zarządzanie środowiskiem wirtualnym

Konfiguracja DNS (dnsmasq):

Basic command line usage for virtual networks

Introduces the basic virsh net-* commands for virtual network management. Here, the <network-identifier> stands for either network name or network UUID.

net-list – List the virtual networks libvirt is aware of, along with some basic status and autostart flag information. Used without parameters it shows active virtual networks only.

Usage: net-list [--all] [--inactive].

net-start – Starts an inactive, previously defined virtual network.

Usage: net-start [--network] <network-identifier>

net-destroy – Stops an active network and deallocates all resources used by it, e.g. stopping appropiate dnsmasq process, releasing the bridge. The virtual network being stopped can be persistent or transient.

Usage: net-destroy [--network] <network-identifier>

net-undefine – Removes an inactive presistent virtual network from the libvirt configuration.

Usage: net-undefine [--network] <network-identifier>

net-autostart – Marks or unmarks automatic startup of a persistent virtual network. Networks with the autostart flag enabled are started whenever libvirt daemon starts. To disable autostart use the –disable switch.

Usage: net-autostart [--network] <network-identifier> [--disable]

net-name – Returns the network name corresponding to the given UUID.

Usage: net-name [--network] <network-uuid>

net-uuid – Returns the UUID corresponding to the given network-name.

Usage: net-uuid [--network] <network-name>

net-dumpxml – Outputs the XML configuration for a virtual network.

Usage: net-dumpxml [--network] <network-identifier>

virsh XML commands

net-edit – Edits the XML configuration of a virtual network. net-edit launches the editor defined in $EDITOR environment variable passing it a temporary copy of the XML configuration file for the virtual network. When the user finishes editing, net-edit checks the temporary file for changes and errors and redefines the virtual network.

Usage: net-edit [--network] <network-identifier>

net-create – Creates a running transient virtual network. Command takes one argument, the full path to an XML file containing network settings.

Usage: net-create [--file] <file-name>

net-define – Creates a persistent virtual network, without starting it, from the given XML file. To start the network use net-autostart and/or net-start.

Usage: net-define [--file] <file-name>