环境
系统:CentOS 7.4
准备
-
检测是否支持KVM
# cat /proc/cpuinfo | grep -E 'vmx|svm'
-
关闭SELinux
# vim /etc/sysconfig/selinux SELinux=disabled
KVM安装启动
-
安装KVM
# yum -y install qemu-kvm libvirt virt-install bridge-utils
-
启动KVM
# systemctl enable libvirtd # systemctl start libvirtd
配置桥接网络
-
创建网桥配置
# vim /etc/sysconfig/network-scripts/ifcfg-br0 DEVICE=br0 ONBOOT=yes TYPE=Bridge BOOTPROTO=static IPADDR=10.0.0.2 NETMASK=255.255.255.0 GATEWAY=10.0.0.1 DEFROUTE=yes
-
编辑网卡配置
# mv /etc/sysconfig/network-scripts/ifcfg-enp1s0 /tmp/ # vim /etc/sysconfig/network-scripts/ifcfg-enp1s0 DEVICE=enp1s0 ONBOOT=yes TYPE=Ethernet BOOTPROTO=none BRIDGE=br0
-
重启网络
# systemctl restart network
网友评论