本文共 648 字,大约阅读时间需要 2 分钟。
kvm中虚拟机网卡默认为nat模式,如果想调整为bridge,只需要进行下面简单的几步:
[root@node160 ~]# virsh edit CentOS-7.3-X86_64
将xml配置文件中的: 1 2 3 4 5 6 | <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 > |
修改为:
1 2 3 4 5 6 | <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 > |