美文网首页技术篇
KVM的几种网络连接方式

KVM的几种网络连接方式

作者: Jzyue | 来源:发表于2019-06-23 19:35 被阅读25次

1、桥接网卡创建

virsh iface-bridge eth0 br0

2、取消桥接网卡

virsh iface-unbridge br0

virsh edit centos7
<interface type='bridge'>
<mac address='52:54:00:55:aa:fa'/>
<source bridge='br0'/>

3、桥接模式

默认NAT模式
virt-install --virt-type kvm --os-type=linux --os-variant rhel7 --name web04 --memory 1024 --vcpus 1 --disk /opt/web04.qcow2 --boot hd --network network=default --graphics vnc,listen=0.0.0.0 --noautoconsole
桥接模式
virt-install --virt-type kvm --os-type=linux --os-variant rhel7 --name web04 --memory 1024 --vcpus 1 --disk /data/web04.qcow2 --boot hd --network bridge=br0 --graphics vnc,listen=0.0.0.0 --noautoconsole

4、热添加技术

kvm虚拟机在线热添加硬盘
临时生效
virsh attach-disk web04 /opt/oldboy.qcow2 vdb --subdriver qcow2
永久生效
virsh attach-disk web04 /opt/oldboy.qcow2 vdb --subdriver qcow2 --config

5、

相关文章

网友评论

    本文标题:KVM的几种网络连接方式

    本文链接:https://www.haomeiwen.com/subject/spcwqctx.html