# 进入root
sudo -i
# 进入虚拟机配置文件目录
cd /etc/libvirt/qemu
# 使用此命令找到对应虚拟机的配置文件
find . -name "*.xml" -type f -exec grep -l "<title>" {} \; -exec sh -c 'echo "File: {}"; grep "<title>" {}' \;
# 编辑对应配置文件的interface内容
<interface type='bridge'>
<mac address='ae:09:cd:46:91:4a'/>
<source bridge='enp3s0-ovs'/>
<virtualport type='openvswitch'>
<parameters interfaceid='ffdf455e-b616-491f-8a15-1e5dfc8687cc'/>
</virtualport>
<model type='e1000'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</interface>
# 为
<interface type='network'>
<mac address='01:02:03:04:05:06'/>
<source network='default'/>
<model type='e1000'/>
<address type='pci' domain='0x0000' bus='0x06' slot='0x02' function='0x0'/>
</interface>
# 修改内容
# 1、修改type='bridge'为type='network'
# 2、修改<source bridge='enp3s0-ovs'/>为<source network='default'/>
# 3、删除virtualport标签