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>
转载于:https://blog.51cto.com/molewan/1974226