技术篇

KVM的几种网络连接方式

2019-06-23  本文已影响25人  Jzyue

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、

上一篇 下一篇

猜你喜欢

热点阅读