15.22. Managing Virtual Networks


You can use virsh to manage virtual networks. To list virtual networks:
virsh net-list
This command generates output similar to:
[root@domain ~]# 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 [vnet name]
This displays information about a specified virtual network in XML format:
	
[root@domain ~]# 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 [XML file] — Generates and starts a new network using a preexisting XML file
  • virsh net-define [XML file] — Generates a new network from a preexisting XML file without starting it
  • virsh net-destroy [network name] — Destroy a network specified as [network name]
  • virsh net-name [network UUID] — Convert a specified [network UUID] to a network name
  • virsh net-uuid [network name — Convert a specified [network name] to a network UUID
  • virsh net-start [name of an inactive network] — Starts a previously undefined inactive network
  • virsh net-undefine [name of an inactive network] — Undefine an inactive network
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.