二:准备镜像制作主机
2.1:网络配置
2.1.1:外部网络配置
br0
[root@node252 ~]# vim /etc/sysconfig/network-scripts/ifcfg-br0
TYPE="Bridge"
BOOTPROTO="static"
NAME="br0"
DEVICE="br0"
ONBOOT="yes"
IPADDR="192.168.1.252"
NETMASK="255.255.255.0"
GATEWAY="192.168.1.1"
DNS1="192.168.1.254"
eth0
[root@node252 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
BOOTPROTO="none"
NAME="eth0"
DEVICE="eth0"
ONBOOT="yes"
BRIDGE="br0"
2.1.2:内部网络配置
br1
[root@node252 ~]# vim /etc/sysconfig/network-scripts/ifcfg-br1
TYPE="Bridge"
BOOTPROTO="static"
NAME="br1"
DEVICE="br1"
ONBOOT="yes"
IPADDR="172.16.1.252"
NETMASK="255.255.255.0"
DNS1="172.16.1.253"
eth1
[root@node252 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth1
BOOTPROTO="none"
NAME="eth1"
DEVICE="eth1"
ONBOOT="yes"
BRIDGE="br1"
2.1.3:重启网络服务并验证
[root@node252 ~]# systemctl restart network
[root@node252 ~]# ping www.baidu.com
PING www.a.shifen.com (180.101.49.12) 56(84) bytes of data.
64 bytes from 180.101.49.12: icmp_seq=1 ttl=52 time=38.5 ms
64 bytes from 180.101.49.12: icmp_seq=2 ttl=52 time=36.1 ms
[root@node252 ~]# ping 172.16.1.101
PING 172.16.1.101 (172.16.1.101) 56(84) bytes of data.
64 bytes from 172.16.1.101: icmp_seq=1 ttl=64 time=1.25 ms
64 bytes from 172.16.1.101: icmp_seq=2 ttl=64 time=0.873 ms
2.2:安装 KVM 环境
[root@node252 ~]# yum install -y qemu-kvm qemu-kvm-tools libvirt virt-manager virt-install
[root@node252 ~]# systemctl enable libvirtd
[root@node252 ~]# systemctl start libvirtd