Product SiteDocumentation Site

2.67. net-uuid

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

Available from libvirt 0.2.0 onwards
Platform or Hypervisor specific notes
None yet
virsh # net-uuid mynetwork
Returns the UUID of the virtual network named "mynetwork".
virsh # net-uuid --network mynetwork
Same as the previous example.
Example in context
Given a virtual network name, we can get its UUID:
virsh # net-uuid examplenetwork
We can confirm by using the net-dumpxml command on the returned network UUID:
virsh # net-dumpxml bfbc4c69-7d6a-cc9a-904c-09910ce179c0 
  <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-uuid is more efficient than dumping the XML for the virtual network and manually extracting the uuid value.
See also
  • net-dumpxml - Outputs the XML configuration for a virtual network, to stdout
  • net-list - Lists the virtual networks libvirt is aware of