一.宿主机创建桥接网络
]# virsh iface-bridge eth0 br0 //创建桥接网卡
]# virsh iface-unbridge br0 //取消时可以使用
二.关机修改配置文件
]# virsh shutdown mmm
]# virsh edit mmm
修改前:
<interface type='network'>
<mac address='52:54:00:f1:40:c3'/>
<source network='vbr0'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<interface type='network'>
<mac address='52:54:00:a4:4f:79'/>
<source network='private1'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
</interface>
<interface type='network'>
<mac address='52:54:00:42:24:4b'/>
<source network='private2'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
</interface>
修改后:
<interface type='bridge'>
<mac address='52:54:00:f1:40:c3'/>
<source bridge='br0'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<interface type='network'>
<mac address='52:54:00:a4:4f:79'/>
<source network='private1'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
</interface>
<interface type='network'>
<mac address='52:54:00:42:24:4b'/>
<source network='private2'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
</interface>
三.启动虚拟机
配静态ip,测试