收起左侧

飞牛换成wifi链接后 虚拟机的网络该怎么设置

2
回复
280
查看
[ 复制链接 ]

8

主题

13

回帖

0

牛值

江湖小虾

2025-8-28 08:49:10 显示全部楼层 阅读模式

如题 因为部分原因 现在需要用wifi链接 但不清楚虚拟机的网络该怎么改

收藏
送赞
分享

1

主题

6

回帖

0

牛值

江湖小虾

2025-9-28 10:42:29 显示全部楼层
# 进入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标签


1

主题

6

回帖

0

牛值

江湖小虾

2025-9-28 11:46:41 显示全部楼层

https://club.fnnas.com/forum.php?mod=viewthread&tid=14624

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则