1. 程式人生 > >KVM:虛擬機網卡模式改為bridge

KVM:虛擬機網卡模式改為bridge

kvm bridge

kvm中虛擬機網卡默認為nat模式,如果想調整為bridge,只需要進行下面簡單的幾步:

[root@node160 ~]# virsh edit CentOS-7.3-X86_64
將xml配置文件中的:

    <interface type=‘network‘>
      <mac address=‘52:54:00:e4:7c:77‘/>
      <source network=‘default‘/>
      <model type=‘virtio‘/>
      <address type=‘pci‘ domain=‘0x0000‘ bus=‘0x00‘ slot=‘0x03‘ function=‘0x0‘/>
    </interface>

修改為:

    <interface type=‘bridge‘>
      <mac address=‘52:54:00:e4:7c:77‘/>
      <source bridge=‘br0‘/>
      <model type=‘virtio‘/>
      <address type=‘pci‘ domain=‘0x0000‘ bus=‘0x00‘ slot=‘0x03‘ function=‘0x0‘/>
    </interface>


本文出自 “冰凍vs西瓜” 博客,請務必保留此出處http://molewan.blog.51cto.com/287340/1974226

KVM:虛擬機網卡模式改為bridge