Product SiteDocumentation Site

2.64. net-name

When given a virtual network UUID, returns its corresponding virtual network name.
net-name --network network-UUID
Table 2.10. Options
Name Required? Description
--network network-UUID
The UUID of the virtual network you want the name for.
The word "--network" itself is optional.

Available from libvirt 0.2.0 onwards
Platform or Hypervisor specific notes
None yet
virsh # net-name b7005dec-be1a-fe9a-338a-0cb1301dfcfd
Returns the name of the virtual network having a UUID of "b7005dec-be1a-fe9a-338a-0cb1301dfcfd".
virsh # net-name --network b7005dec-be1a-fe9a-338a-0cb1301dfcfd
Same as the above example.
Example in context
Given a virtual network UUID, we can determine which virtual network it belongs to:
virsh # net-name b7005dec-be1a-fe9a-338a-0cb1301dfcfd
We can confirm by using the net-dumpxml command on the returned network name:
virsh # net-dumpxml examplenetwork
  <name>examplenetwork</name>                        <-- the name is here
  <uuid>b7005dec-be1a-fe9a-338a-0cb1301dfcfd</uuid>  <-- the UUID is here
  <forward mode='route'/>
  <bridge name='virbr100' stp='on' delay='1' />
  <ip address='' netmask=''>
Using net-name is more efficient than dumping the XML for the virtual network and manually extracting the name value.
See also
  • net-dumpxml - Outputs the XML configuration for a virtual network, to stdout