Show Table of Contents
14.14. Managing Virtual Networks
This section covers managing virtual networks with the
virsh command. To list virtual networks:
# virsh net-list
This command generates output similar to:
# virsh net-list Name State Autostart ----------------------------------------- default active yes vnet1 active yes vnet2 active yes
To view network information for a specific virtual network:
# virsh net-dumpxml NetworkName
This displays information about a specified virtual network in XML format:
# virsh net-dumpxml vnet1
<network>
<name>vnet1</name>
<uuid>98361b46-1581-acb7-1643-85a412626e70</uuid>
<forward dev='eth0'/>
<bridge name='vnet0' stp='on' forwardDelay='0' />
<ip address='192.168.100.1' netmask='255.255.255.0'>
<dhcp>
<range start='192.168.100.128' end='192.168.100.254' />
</dhcp>
</ip>
</network>
Other
virsh commands used in managing virtual networks are:
virsh net-autostart network-name— Autostart a network specified as network-name.virsh net-create XMLfile— generates and starts a new network using an existing XML file.virsh net-define XMLfile— generates a new network device from an existing XML file without starting it.virsh net-destroy network-name— destroy a network specified as network-name.virsh net-name networkUUID— convert a specified networkUUID to a network name.virsh net-uuid network-name— convert a specified network-name to a network UUID.virsh net-start nameOfInactiveNetwork— starts an inactive network.virsh net-undefine nameOfInactiveNetwork— removes the definition of an inactive network.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.