1.1 安装KVM虚拟机
[ root@jztserver01 ~]
[ root@jztserver01 ~]
[ root@jztserver01 ~]
[ root@jztserver01 ~]
[ root@jztserver01 ~]
[ root@jztserver01 ~]
[ root@jztserver01 ~]
[ root@jztserver01 ~]
[ root@jztserver01 ~]
[ root@jztserver01 ~]
[ root@jztserver01 yum.repos.d]
[ root@jztserver01 yum.repos.d]
[ root@jztserver01 yum.repos.d]
[ root@jztserver01 yum.repos.d]
[ root@jztserver01 yum.repos.d]
[ root@jztserver01 yum.repos.d]
[ root@jztserver01 yum.repos.d]
[ root@jztserver01 yum.repos.d]
[ root@jztserver01 yum.repos.d]
[ root@jztserver01 yum.repos.d]
[ root@jztserver01 yum.repos.d]
1.2 配置网络
[ root@jztserver01 /]
[ root@jztserver01 network-scripts]
[ root@jztserver01 network-scripts]
TYPE = Bridge
PROXY_METHOD = none
BROWSER_ONLY = no
NM_CONTROLLED = no
BOOTPROTO = static
DEFROUTE = yes
IPV4_FAILURE_FATAL = yes
IPV6INIT = yes
IPV6_AUTOCONF = yes
IPV6_DEFROUTE = yes
IPV6_FAILURE_FATAL = no
IPV6_ADDR_GEN_MODE = stable-privacy
IPV6_PRIVACY = no
NAME = br1
DEVICE = br1
ONBOOT = yes
IPADDR = xxx.xxx.xxx.xxxx
GATEWAY = 192.168 .0.1
NETMASK = 255.255 .255.0
DNS1 = xxx.xxx.xxx.xxxx
DNS2 = 114.114 .114.114
[ root@jztserver01 network-scripts]
TYPE = Ethernet
PROXY_METHOD = none
BROWSER_ONLY = no
NM_CONTROLLED = no
BOOTPROTO = dhcp
DEFROUTE = yes
IPV4_FAILURE_FATAL = no
IPV6INIT = yes
IPV6_AUTOCONF = yes
IPV6_DEFROUTE = yes
IPV6_FAILURE_FATAL = no
IPV6_ADDR_GEN_MODE = stable-privacy
IPV6_PRIVACY = no
NAME = enp2s0f0
DEVICE = enp2s0f0
ONBOOT = yes
UUID = 78befe25-7a8c-4b2f-a947-b64d773b6c0d
HWADDR = f0:2f:a7:3b:ca:13
BRIDGE = br1
[ root@jztserver01 network-scripts]
[ root@jztserver01 network-scripts]
1 : lo: < LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0 .0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::1/128 scope host valid_lft forever preferred_lft forever
2 : enp2s0f0: < BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master br1 state UP group default qlen 1000 link/ether f0:2f:a7:3b:ca:13 brd ff:ff:ff:ff:ff:ffinet6 fe80::f22f:a7ff:fe3b:ca13/64 scope link valid_lft forever preferred_lft forever
3 : enp2s0f1: < NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000 link/ether f0:2f:a7:3b:ca:14 brd ff:ff:ff:ff:ff:ff
4 : br1: < BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether f0:2f:a7:3b:ca:13 brd ff:ff:ff:ff:ff:ffinet 192.168 .0.240/23 brd 192.168 .1.255 scope global br1valid_lft forever preferred_lft foreverinet6 fe80::f22f:a7ff:fe3b:ca13/64 scope link valid_lft forever preferred_lft forever
5 : virbr0: < NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000 link/ether 52 :54:00:26:5d:d9 brd ff:ff:ff:ff:ff:ffinet 192.168 .122.1/24 brd 192.168 .122.255 scope global virbr0valid_lft forever preferred_lft forever
6 : virbr0-nic: < BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000 link/ether 52 :54:00:26:5d:d9 brd ff:ff:ff:ff:ff:ff
7 : vnet0: < BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br1 state UNKNOWN group default qlen 1000 link/ether fe:54:00:d0:11:ce brd ff:ff:ff:ff:ff:ffinet6 fe80::fc54:ff:fed0:11ce/64 scope link valid_lft forever preferred_lft forever
8 : vnet1: < BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br1 state UNKNOWN group default qlen 1000 link/ether fe:54:00:67:95:6e brd ff:ff:ff:ff:ff:ffinet6 fe80::fc54:ff:fe67:956e/64 scope link valid_lft forever preferred_lft forever
9 : vnet2: < BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br1 state UNKNOWN group default qlen 1000 link/ether fe:54:00:04:36:5a brd ff:ff:ff:ff:ff:ffinet6 fe80::fc54:ff:fe04:365a/64 scope link valid_lft forever preferred_lft forever
10 : vnet3: < BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br1 state UNKNOWN group default qlen 1000 link/ether fe:54:00:41:50:cf brd ff:ff:ff:ff:ff:ffinet6 fe80::fc54:ff:fe41:50cf/64 scope link valid_lft forever preferred_lft forever
[ root@jztserver01 network-scripts]
bridge name bridge id STP enabled interfaces
br1 8000 .f02fa73bca13 no enp2s0f0
virbr0 8000 .525400265dd9 yes virbr0-nic
[ root@jztserver01 network-scripts]
[ root@jztserver01 sdb1]
[ root@jztserver01 sdb1]
[ root@jztserver01 sdb1]
[ root@jztserver01 iso]
总用量 4 .4G
-rw-r--r-- 1 qemu qemu 4 .4G 10 月 24 12 :31 CentOS-7-x86_64-DVD-2009.iso
[ root@jztserver01 iso]
[ root@jztserver01 centos-kvm]
/mnt/sdb1/centos-kvm
[ root@jztserver01 centos-kvm]
[ root@jztserver01 centos-kvm]
[ root@jztserver01 centos-kvm]
[ root@jztserver01 centos-kvm]
[ root@jztserver01 centos-kvm]
[ root@localhost network-scripts]
TYPE = Ethernet
PROXY_METHOD = none
BROWSER_ONLY = no
BOOTPROTO = static
DEFROUTE = yes
IPV4_FAILURE_FATAL = no
IPV6INIT = yes
IPV6_AUTOCONF = yes
IPV6_DEFROUTE = yes
IPV6_FAILURE_FATAL = no
IPV6_ADDR_GEN_MODE = stable-privacy
NAME = eth0
UUID = 6388371e-23ae-43f4-9f20-7fce5a0d42f7
DEVICE = eth0
ONBOOT = yes
IPADDR = 192.168 .0.241
GATEWAY = 192.168 .0.1
NETMASK = 255.255 .254.0
DNS1 = xxx.xxx.xxx.xxx
DNS2 = 114.114 .114.114
[ root@localhost network-scripts]
[ root@localhost network-scripts]
[ root@localhost network-scripts]
[ root@localhost network-scripts]
[ root@localhost network-scripts]
ctrl + ]
[ root@jztserver01 centos-kvm]
[ root@jztserver01 centos-kvm]
[ root@jztserver01 centos-kvm]
[ root@jztserver01 centos-kvm]
[ root@jztserver01 centos-kvm]
[ root@jztserver01 centos-kvm]
[ root@jztserver01 centos-kvm]
[ root@jztserver01 centos-kvm]
[ root@jztserver01 centos-kvm]
[ root@jztserver01 centos-kvm]
[ root@jztserver01 centos-kvm]
[ root@jztserver01 centos-kvm]
[ root@localhost ~]
[ root@localhost network-scripts]
1.3 KVM常见命令
[ root@jztserver01 /]
[ root@jztserver01 /]
[ root@jztserver01 /]
[ root@jztserver01 /]
[ root@jztserver01 /]
[ root@jztserver01 /]
[ root@jztserver01 /]
[ root@jztserver01 /]
[ root@jztserver01 /]
[ root@jztserver01 /]
[ root@jztserver01 /]
Id: 2
名称: centos1
UUID: 37c389a7-749d-41b6-8eee-f9788f185719
OS 类型: hvm
状态: running
CPU: 16
CPU 时间: 54 .9s
最大内存: 16777216 KiB
使用的内存: 16777216 KiB
持久: 是
自动启动: 启用
管理的保存: 否
安全性模式: none
安全性 DOI: 0
[ root@jztserver01 /]
接口 类型 源 型号 MAC
-------------------------------------------------------
vnet1 bridge br1 virtio 52 :54:00:67:95:6e