kvm宿主机创建桥接网络

一.宿主机创建桥接网络
]# 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,测试

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。